9bcd967b8ad4076c19311b791b3a2f0b589c57b0
[oweals/openwrt.git] /
1 From 91da858c9327352c17a1f20ec10e78113ed45c82 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 6 Nov 2019 13:58:18 +0000
4 Subject: [PATCH] staging: vchiq_arm: Unify the unload handling of
5  platform devs
6
7 A helper function vchiq_register_child was added to deal with
8 adding the platform devices. This returns NULL on failure, and
9 that is assigned to the struct platform_device. There is
10 therefore no way for remove to encounter an error pointer, so
11 checking for IS_ERR() is redundant.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 ---
15  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +--
16  1 file changed, 1 insertion(+), 2 deletions(-)
17
18 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
19 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
20 @@ -3268,8 +3268,7 @@ failed_platform_init:
21  
22  static int vchiq_remove(struct platform_device *pdev)
23  {
24 -       if (!IS_ERR(bcm2835_camera))
25 -               platform_device_unregister(bcm2835_camera);
26 +       platform_device_unregister(bcm2835_camera);
27         platform_device_unregister(bcm2835_codec);
28         platform_device_unregister(vcsm_cma);
29         vchiq_debugfs_deinit();