* [PATCH] leds: lm3533: Switch to using the new API kobj_to_dev()
@ 2020-11-30 1:19 Tian Tao
2020-12-17 21:13 ` Pavel Machek
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-11-30 1:19 UTC (permalink / raw)
To: pavel, dmurphy; +Cc: linux-leds, linux-kernel
fixed the following coccicheck:
drivers/leds/leds-lm3533.c:611:60-61: WARNING opportunity for kobj_to_dev().
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/leds/leds-lm3533.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c
index b3edee7..9791166 100644
--- a/drivers/leds/leds-lm3533.c
+++ b/drivers/leds/leds-lm3533.c
@@ -608,7 +608,7 @@ static struct attribute *lm3533_led_attributes[] = {
static umode_t lm3533_led_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct lm3533_led *led = to_lm3533_led(led_cdev);
umode_t mode = attr->mode;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] leds: lm3533: Switch to using the new API kobj_to_dev()
2020-11-30 1:19 [PATCH] leds: lm3533: Switch to using the new API kobj_to_dev() Tian Tao
@ 2020-12-17 21:13 ` Pavel Machek
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2020-12-17 21:13 UTC (permalink / raw)
To: Tian Tao; +Cc: dmurphy, linux-leds, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
On Mon 2020-11-30 09:19:28, Tian Tao wrote:
> fixed the following coccicheck:
> drivers/leds/leds-lm3533.c:611:60-61: WARNING opportunity for kobj_to_dev().
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Thanks, applied.
Pavel
--
http://www.livejournal.com/~pavelmachek
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-17 21:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 1:19 [PATCH] leds: lm3533: Switch to using the new API kobj_to_dev() Tian Tao
2020-12-17 21:13 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).