summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 21:28:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 17:29:51 +0300
commitf6d1975cd2668d239bb97ef4833ad1ddc5ffed6d (patch)
treefd615e1342aad5eccb95ad6939d76a5e20ac1378 /arch/sh
parentc93bd175414ac43d7ea6cb2a17f49eb91af03f00 (diff)
downloadlinux-f6d1975cd2668d239bb97ef4833ad1ddc5ffed6d.tar.xz
sh: dma-sysfs: 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-16-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 8ef318150f84..431bc18f0a41 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -45,13 +45,19 @@ static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL);
static int __init dma_subsys_init(void)
{
+ struct device *dev_root;
int ret;
ret = subsys_system_register(&dma_subsys, NULL);
if (unlikely(ret))
return ret;
- return device_create_file(dma_subsys.dev_root, &dev_attr_devices);
+ dev_root = bus_get_dev_root(&dma_subsys);
+ if (dev_root) {
+ ret = device_create_file(dev_root, &dev_attr_devices);
+ put_device(dev_root);
+ }
+ return ret;
}
postcore_initcall(dma_subsys_init);