* [PATCH 1/1] mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro
@ 2021-06-03 12:33 Zhen Lei
2021-06-11 19:02 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2021-06-03 12:33 UTC (permalink / raw)
To: Maxim Levitsky, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd
Cc: Zhen Lei
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 <thunder.leizhen@huawei.com>
---
drivers/mtd/nand/raw/r852.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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 */
--
2.26.0.106.g9fadedd
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro
2021-06-03 12:33 [PATCH 1/1] mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro Zhen Lei
@ 2021-06-11 19:02 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-06-11 19:02 UTC (permalink / raw)
To: Zhen Lei, Maxim Levitsky, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd
On Thu, 2021-06-03 at 12:33:39 UTC, Zhen Lei wrote:
> 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 <thunder.leizhen@huawei.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-11 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 12:33 [PATCH 1/1] mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro Zhen Lei
2021-06-11 19:02 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.