From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 18:28:59 +0000 (+0100) Subject: sh: intc: move to use bus_get_dev_root() X-Git-Tag: v6.4-rc1~115^2~79 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=93c42c0b0303b47fbb71cb2a633bcd45eca8b644;p=tomoyo%2Ftomoyo-test1.git 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 Cc: Rich Felker Cc: linux-sh@vger.kernel.org Acked-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230313182918.1312597-17-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c index f9f043a3d90a..abe9091827cd 100644 --- a/drivers/sh/intc/userimask.c +++ b/drivers/sh/intc/userimask.c @@ -61,10 +61,18 @@ static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR, static int __init userimask_sysdev_init(void) { + struct device *dev_root; + int ret = 0; + if (unlikely(!uimask)) return -ENXIO; - return device_create_file(intc_subsys.dev_root, &dev_attr_userimask); + dev_root = bus_get_dev_root(&intc_subsys); + if (dev_root) { + ret = device_create_file(dev_root, &dev_attr_userimask); + put_device(dev_root); + } + return ret; } late_initcall(userimask_sysdev_init);