diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-03-17 18:00:59 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2017-03-17 16:44:09 -0700 |
commit | cc2e6da1b5a8986dc2831d5b63f4d0a15704e4f1 (patch) | |
tree | ae6e8a1664bd2f3e4611434509a7b9c573cbd686 /drivers/gpu/drm/vc4 | |
parent | d5b72a2123dfaf9416b1a1177b4be041f8a8b6d4 (diff) | |
download | op-kernel-dev-cc2e6da1b5a8986dc2831d5b63f4d0a15704e4f1.zip op-kernel-dev-cc2e6da1b5a8986dc2831d5b63f4d0a15704e4f1.tar.gz |
drm/vc4: use platform_register_drivers
Use platform_register_drivers instead of open coding the iteration over
component platform drivers in the vc4_drv module.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170317170059.17821-1-p.zabel@pengutronix.de
Diffstat (limited to 'drivers/gpu/drm/vc4')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_drv.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 205c196..61e674b 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -349,26 +349,20 @@ static struct platform_driver vc4_platform_driver = { static int __init vc4_drm_register(void) { - int i, ret; + int ret; + + ret = platform_register_drivers(component_drivers, + ARRAY_SIZE(component_drivers)); + if (ret) + return ret; - for (i = 0; i < ARRAY_SIZE(component_drivers); i++) { - ret = platform_driver_register(component_drivers[i]); - if (ret) { - while (--i >= 0) - platform_driver_unregister(component_drivers[i]); - return ret; - } - } return platform_driver_register(&vc4_platform_driver); } static void __exit vc4_drm_unregister(void) { - int i; - - for (i = ARRAY_SIZE(component_drivers) - 1; i >= 0; i--) - platform_driver_unregister(component_drivers[i]); - + platform_unregister_drivers(component_drivers, + ARRAY_SIZE(component_drivers)); platform_driver_unregister(&vc4_platform_driver); } |