Skip to content

Commit ba35884

Browse files
ukleinekthierryreding
authored andcommitted
host1x: Make remove callback return void
The return value of struct device_driver::remove is ignored by the core (see device_remove() in drivers/base/dd.c). So it doesn't make sense to let the host1x remove callback return an int just to ignore it later. So make the callback return void. All current implementors return 0, so they are easily converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20 tegra-video Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patch.msgid.link/d364fd4ec043d36ee12e46eaef98c57658884f63.1765355236.git.u.kleine-koenig@baylibre.com
1 parent 4a768c5 commit ba35884

5 files changed

Lines changed: 5 additions & 11 deletions

File tree

drivers/crypto/tegra/tegra-se-main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,9 @@ static int tegra_se_host1x_probe(struct host1x_device *dev)
401401
return host1x_device_init(dev);
402402
}
403403

404-
static int tegra_se_host1x_remove(struct host1x_device *dev)
404+
static void tegra_se_host1x_remove(struct host1x_device *dev)
405405
{
406406
host1x_device_exit(dev);
407-
408-
return 0;
409407
}
410408

411409
static struct host1x_driver tegra_se_host1x_driver = {

drivers/gpu/drm/tegra/drm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
13011301
return err;
13021302
}
13031303

1304-
static int host1x_drm_remove(struct host1x_device *dev)
1304+
static void host1x_drm_remove(struct host1x_device *dev)
13051305
{
13061306
struct drm_device *drm = dev_get_drvdata(&dev->dev);
13071307
struct tegra_drm *tegra = drm->dev_private;
@@ -1330,8 +1330,6 @@ static int host1x_drm_remove(struct host1x_device *dev)
13301330

13311331
kfree(tegra);
13321332
drm_dev_put(drm);
1333-
1334-
return 0;
13351333
}
13361334

13371335
static void host1x_drm_shutdown(struct host1x_device *dev)

drivers/gpu/host1x/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static int host1x_device_remove(struct device *dev)
640640
struct host1x_device *device = to_host1x_device(dev);
641641

642642
if (driver->remove)
643-
return driver->remove(device);
643+
driver->remove(device);
644644

645645
return 0;
646646
}

drivers/staging/media/tegra-video/video.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int host1x_video_probe(struct host1x_device *dev)
107107
return ret;
108108
}
109109

110-
static int host1x_video_remove(struct host1x_device *dev)
110+
static void host1x_video_remove(struct host1x_device *dev)
111111
{
112112
struct tegra_video_device *vid = dev_get_drvdata(&dev->dev);
113113

@@ -118,8 +118,6 @@ static int host1x_video_remove(struct host1x_device *dev)
118118

119119
/* This calls v4l2_dev release callback on last reference */
120120
v4l2_device_put(&vid->v4l2_dev);
121-
122-
return 0;
123121
}
124122

125123
static const struct of_device_id host1x_video_subdevs[] = {

include/linux/host1x.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ struct host1x_driver {
380380
struct list_head list;
381381

382382
int (*probe)(struct host1x_device *device);
383-
int (*remove)(struct host1x_device *device);
383+
void (*remove)(struct host1x_device *device);
384384
void (*shutdown)(struct host1x_device *device);
385385
};
386386

0 commit comments

Comments
 (0)