From patchwork Thu Jun 3 12:33:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 453253 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp231965jao; Thu, 3 Jun 2021 05:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq6ndsl+5a4yc6bre+5Irc/Py2pIY75DV1aXk0y0rcfX27j+0Lni4zLJ2rVQtI0y1fwWLQ X-Received: by 2002:a50:eb08:: with SMTP id y8mr44063089edp.89.1622723649238; Thu, 03 Jun 2021 05:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622723649; cv=none; d=google.com; s=arc-20160816; b=v0p5bYcKzCdnIqvUifBNMdYynGcSqmiZ+79slfVK0H0S7Q0PLxUq9uJHWiw7WZ3jiP Xn2usa8D9HEvYa3Uqkhd1/K3md5Woau+x+2+wVmOjkje66vfg/VpSDA/GGZuzlWbrqTa 1gDquEGyRpjT4x8BpV+JAM1OFPXvhaCC2CJXJrDD2ShL3NzI0KGDMF9Sain3tV1gzY6h IikTbPRopLDjn5Bw1wMtCa/lRSiVUZHszqB+Pm7O6T0j7PN4BSEqkK3vWgaBZsvrWP4R ekMnsSzbVTcvI+feQWYGN3Jm5b/1Bf6uWDRJ0fnBWrd9CnysiEG1Ag8aLMmqpikGyCCH 126Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=BI4qoA+8QDgnfmPCTiFKEuV7Y1TXHOsS6LYVxULqBS4=; b=FuRmCqrCGlELaoBk2LY6uLv69kIGmcx/jHc+QHozWgrTA1B57LPsNZ0rV5R9VTP0wm 2BiO2mLD7+CaEJuJXC6SH3Xr0fT+lnQ/Gmm9Ob5RadhucG4Ve5tv0kbd9amPV6iDWs+v rzq9wHwtqsKJwhHPf2oPKvcXl0hq/T7eP2EFlvvdzpmy9UZqd+dajBK2LPYFK591Awrh NgQgsKluQA3Wj0/z8LZsa/nngQbp/jybIAKcnSJA68PDOMYn6JpybUZhBCa6TWjW4Lh1 IVDqCmBQ63gvEMOM3uJ4+XNTSmZHUQsPimfXnBtWRfLlUocNA39oHFlvdcgwOY9olovP yb+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=d4wWT3Y1; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id b24si2149904ejl.625.2021.06.03.05.34.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 05:34:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=d4wWT3Y1; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BI4qoA+8QDgnfmPCTiFKEuV7Y1TXHOsS6LYVxULqBS4=; b=d4wWT3Y1vWwe7g /Rwuo1bfG72HFnDImdkQkwBeGTfIhafnfJWc0tZ+ZHthEuiVkl5C+m4aVTF6y09HTui7tHc38nWcO hxe+nnZsHoBN99SiD4eXEQv/pL0D5wK71vG4DL9wnoZ6NZE/gOBiCt2WML+ckC3USUoNvZ0bm5ovK WjTmXUe41eVVGW3toprXyKe8/JGW0Wd0LQZvHbCrcL/w1ELILcsPb3UfeUT5iYMvrBk8iMfFx97bW /vf4vHEkXLvMEFKMfxeDPz+nNy8tUUGezj3WKy/xpZN1AMGMasBJaNDO273+roD6UVEb7/Avn9t5P 13aX145DTpw113B60Bdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomXn-008eTY-AE; Thu, 03 Jun 2021 12:33:51 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomXk-008eRd-2p for linux-mtd@lists.infradead.org; Thu, 03 Jun 2021 12:33:49 +0000 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FwlZ30GTzzWlcd; Thu, 3 Jun 2021 20:28:59 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 3 Jun 2021 20:33:43 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 3 Jun 2021 20:33:42 +0800 From: Zhen Lei To: Maxim Levitsky , Miquel Raynal , Richard Weinberger , "Vignesh Raghavendra" , linux-mtd CC: Zhen Lei Subject: [PATCH 1/1] mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro Date: Thu, 3 Jun 2021 20:33:39 +0800 Message-ID: <20210603123339.12089-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_053348_393458_E65F1E58 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Use DEVICE_ATTR_RO() helper macro instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mtd/nand/raw/r852.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.187 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Use DEVICE_ATTR_RO() helper macro instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mtd/nand/raw/r852.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.26.0.106.g9fadedd ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c index ebe859ca49cbfa1..ed0cf732d20e40a 100644 --- a/drivers/mtd/nand/raw/r852.c +++ b/drivers/mtd/nand/raw/r852.c @@ -583,8 +583,8 @@ static void r852_update_card_detect(struct r852_device *dev) r852_write_reg(dev, R852_CARD_IRQ_ENABLE, card_detect_reg); } -static ssize_t r852_media_type_show(struct device *sys_dev, - struct device_attribute *attr, char *buf) +static ssize_t media_type_show(struct device *sys_dev, + struct device_attribute *attr, char *buf) { struct mtd_info *mtd = container_of(sys_dev, struct mtd_info, dev); struct r852_device *dev = r852_get_dev(mtd); @@ -593,8 +593,7 @@ static ssize_t r852_media_type_show(struct device *sys_dev, strcpy(buf, data); return strlen(data); } - -static DEVICE_ATTR(media_type, S_IRUGO, r852_media_type_show, NULL); +static DEVICE_ATTR_RO(media_type); /* Detect properties of card in slot */