Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: asus-laptop: fix kobj_to_dev.cocci warnings

Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103171258010.2981@hadrien
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

kernel test robot and committed by
Hans de Goede
70505a71 04cdaf6d

+1 -1
+1 -1
drivers/platform/x86/asus-laptop.c
··· 1569 1569 struct attribute *attr, 1570 1570 int idx) 1571 1571 { 1572 - struct device *dev = container_of(kobj, struct device, kobj); 1572 + struct device *dev = kobj_to_dev(kobj); 1573 1573 struct asus_laptop *asus = dev_get_drvdata(dev); 1574 1574 acpi_handle handle = asus->handle; 1575 1575 bool supported;