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

sh: intc: move to use bus_get_dev_root()

Direct access to the struct bus_type dev_root pointer is going away soon
so replace that with a call to bus_get_dev_root() instead, which is what
it is there for.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20230313182918.1312597-17-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -1
+9 -1
drivers/sh/intc/userimask.c
··· 61 61 62 62 static int __init userimask_sysdev_init(void) 63 63 { 64 + struct device *dev_root; 65 + int ret = 0; 66 + 64 67 if (unlikely(!uimask)) 65 68 return -ENXIO; 66 69 67 - return device_create_file(intc_subsys.dev_root, &dev_attr_userimask); 70 + dev_root = bus_get_dev_root(&intc_subsys); 71 + if (dev_root) { 72 + ret = device_create_file(dev_root, &dev_attr_userimask); 73 + put_device(dev_root); 74 + } 75 + return ret; 68 76 } 69 77 late_initcall(userimask_sysdev_init); 70 78