Skip to content

Commit

Permalink
sh: dma-sysfs: move to use bus_get_dev_root()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Mar 17, 2023
1 parent c93bd17 commit f6d1975
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/sh/drivers/dma/dma-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f6d1975

Please sign in to comment.