Skip to content

Commit 5fe09e1

Browse files
Tian Taopavelmachek
authored andcommitted
leds: trigger: pattern: Switch to using the new API kobj_to_dev()
Switch to using the new API kobj_to_dev() to fix the below warnning: ./drivers/leds/trigger/ledtrig-pattern.c:336:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 1cfa807 commit 5fe09e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/leds/trigger/ledtrig-pattern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static DEVICE_ATTR_RW(hw_pattern);
333333
static umode_t pattern_trig_attrs_mode(struct kobject *kobj,
334334
struct attribute *attr, int index)
335335
{
336-
struct device *dev = container_of(kobj, struct device, kobj);
336+
struct device *dev = kobj_to_dev(kobj);
337337
struct led_classdev *led_cdev = dev_get_drvdata(dev);
338338

339339
if (attr == &dev_attr_repeat.attr || attr == &dev_attr_pattern.attr)

0 commit comments

Comments
 (0)