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

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>

+7 -1
+7 -1
arch/sh/drivers/dma/dma-sysfs.c
··· 45 45 46 46 static int __init dma_subsys_init(void) 47 47 { 48 + struct device *dev_root; 48 49 int ret; 49 50 50 51 ret = subsys_system_register(&dma_subsys, NULL); 51 52 if (unlikely(ret)) 52 53 return ret; 53 54 54 - return device_create_file(dma_subsys.dev_root, &dev_attr_devices); 55 + dev_root = bus_get_dev_root(&dma_subsys); 56 + if (dev_root) { 57 + ret = device_create_file(dev_root, &dev_attr_devices); 58 + put_device(dev_root); 59 + } 60 + return ret; 55 61 } 56 62 postcore_initcall(dma_subsys_init); 57 63