Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1656181 > unrolled thread
| Started by | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| First post | 2017-06-02 14:30 +0200 |
| Last post | 2017-06-02 14:30 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[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
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2017-06-02 14:30 +0200 |
| Subject | [PATCH 1/5] rtc: sysfs: make name uniform |
| Message-ID | <tNTSh-11x-7@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2017-06-02 14:30 +0200 |
| Subject | [PATCH 4/5] rtc: ds1307: avoid using rtc-name |
| Message-ID | <tNTSi-11x-35@gated-at.bofh.it> |
| In reply to | #1656181 |
ds1307->rtc->name is a copy of ds1307->client->name, use it instead.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
drivers/rtc/rtc-ds1307.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 77339b3d50a1..99e893ddd029 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1728,7 +1728,7 @@ static int ds1307_probe(struct i2c_client *client,
err = devm_request_threaded_irq(&client->dev,
client->irq, NULL, irq_handler,
IRQF_SHARED | IRQF_ONESHOT,
- ds1307->rtc->name, client);
+ ds1307->client->name, client);
if (err) {
client->irq = 0;
device_set_wakeup_capable(&client->dev, false);
--
2.11.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web