Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1656181
| Path | csiph.com!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/5] rtc: sysfs: make name uniform |
| Date | Fri, 02 Jun 2017 14:30:02 +0200 |
| Message-ID | <tNTSh-11x-7@gated-at.bofh.it> (permalink) |
| X-Mailer | git-send-email 2.11.0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 33 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | rtc-linux@googlegroups.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Belloni <alexandre.belloni@free-electrons.com> |
| X-Original-Date | Fri, 2 Jun 2017 14:21:53 +0200 |
| X-Original-Message-ID | <20170602122157.4677-1-alexandre.belloni@free-electrons.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1656181 |
Show key headers only | View raw
The name sysfs attribute is not useful in its current form because of all
the drivers:
- 3 are using the feature correctly
- 2 are clearly misusing it
- 60 are using driver.name, either directly or indirectly
- 46 are using pdev->name
- 8 are using client->name
- 31 are using a variation of driver.name (addition or removal of rtc-,
-rtc, _rtc, rtc_)
Make it uniform and use the driver name and the device name.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
drivers/rtc/rtc-sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 1218d5d4224d..e364550eb9a7 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -27,7 +27,8 @@
static ssize_t
name_show(struct device *dev, struct device_attribute *attr, char *buf)
{
- return sprintf(buf, "%s\n", to_rtc_device(dev)->name);
+ return sprintf(buf, "%s %s\n", dev_driver_string(dev->parent),
+ dev_name(dev->parent));
}
static DEVICE_ATTR_RO(name);
--
2.11.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/5] rtc: sysfs: make name uniform Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-02 14:30 +0200 [PATCH 4/5] rtc: ds1307: avoid using rtc-name Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-02 14:30 +0200
csiph-web