Skip to content

Commit

Permalink
spi: make remove callback a void function
Browse files Browse the repository at this point in the history
The value returned by an spi driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Jérôme Pouiller <[email protected]>
Acked-by: Miquel Raynal <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Acked-by: Claudius Heine <[email protected]>
Acked-by: Stefan Schmidt <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Ulf Hansson <[email protected]> # For MMC
Acked-by: Marcus Folkesson <[email protected]>
Acked-by: Łukasz Stelmach <[email protected]>
Acked-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Uwe Kleine-König authored and broonie committed Feb 9, 2022
1 parent afb0a80 commit a0386bb
Show file tree
Hide file tree
Showing 191 changed files with 197 additions and 545 deletions.
4 changes: 1 addition & 3 deletions drivers/bus/moxtet.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ static int moxtet_probe(struct spi_device *spi)
return 0;
}

static int moxtet_remove(struct spi_device *spi)
static void moxtet_remove(struct spi_device *spi)
{
struct moxtet *moxtet = spi_get_drvdata(spi);

Expand All @@ -828,8 +828,6 @@ static int moxtet_remove(struct spi_device *spi)
device_for_each_child(moxtet->dev, NULL, __unregister);

mutex_destroy(&moxtet->lock);

return 0;
}

static const struct of_device_id moxtet_dt_ids[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/char/tpm/st33zp24/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,11 @@ static int st33zp24_spi_probe(struct spi_device *dev)
* @param: client, the spi_device description (TPM SPI description).
* @return: 0 in case of success.
*/
static int st33zp24_spi_remove(struct spi_device *dev)
static void st33zp24_spi_remove(struct spi_device *dev)
{
struct tpm_chip *chip = spi_get_drvdata(dev);

st33zp24_remove(chip);

return 0;
}

static const struct spi_device_id st33zp24_spi_id[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/char/tpm/tpm_tis_spi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,12 @@ static int tpm_tis_spi_driver_probe(struct spi_device *spi)

static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_spi_resume);

static int tpm_tis_spi_remove(struct spi_device *dev)
static void tpm_tis_spi_remove(struct spi_device *dev)
{
struct tpm_chip *chip = spi_get_drvdata(dev);

tpm_chip_unregister(chip);
tpm_tis_remove(chip);
return 0;
}

static const struct spi_device_id tpm_tis_spi_id[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/clk/clk-lmk04832.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,14 +1544,12 @@ static int lmk04832_probe(struct spi_device *spi)
return ret;
}

static int lmk04832_remove(struct spi_device *spi)
static void lmk04832_remove(struct spi_device *spi)
{
struct lmk04832 *lmk = spi_get_drvdata(spi);

clk_disable_unprepare(lmk->oscin);
of_clk_del_provider(spi->dev.of_node);

return 0;
}
static const struct spi_device_id lmk04832_id[] = {
{ "lmk04832", LMK04832 },
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-74x164.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ static int gen_74x164_probe(struct spi_device *spi)
return ret;
}

static int gen_74x164_remove(struct spi_device *spi)
static void gen_74x164_remove(struct spi_device *spi)
{
struct gen_74x164_chip *chip = spi_get_drvdata(spi);

gpiod_set_value_cansleep(chip->gpiod_oe, 0);
gpiochip_remove(&chip->gpio_chip);
mutex_destroy(&chip->lock);

return 0;
}

static const struct spi_device_id gen_74x164_spi_ids[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-max3191x.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,12 @@ static int max3191x_probe(struct spi_device *spi)
return 0;
}

static int max3191x_remove(struct spi_device *spi)
static void max3191x_remove(struct spi_device *spi)
{
struct max3191x_chip *max3191x = spi_get_drvdata(spi);

gpiochip_remove(&max3191x->gpio);
mutex_destroy(&max3191x->lock);

return 0;
}

static int __init max3191x_register_driver(struct spi_driver *sdrv)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-max7301.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ static int max7301_probe(struct spi_device *spi)
return ret;
}

static int max7301_remove(struct spi_device *spi)
static void max7301_remove(struct spi_device *spi)
{
__max730x_remove(&spi->dev);

return 0;
}

static const struct spi_device_id max7301_id[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-mc33880.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,14 @@ static int mc33880_probe(struct spi_device *spi)
return ret;
}

static int mc33880_remove(struct spi_device *spi)
static void mc33880_remove(struct spi_device *spi)
{
struct mc33880 *mc;

mc = spi_get_drvdata(spi);

gpiochip_remove(&mc->chip);
mutex_destroy(&mc->lock);

return 0;
}

static struct spi_driver mc33880_driver = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpio/gpio-pisosr.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ static int pisosr_gpio_probe(struct spi_device *spi)
return 0;
}

static int pisosr_gpio_remove(struct spi_device *spi)
static void pisosr_gpio_remove(struct spi_device *spi)
{
struct pisosr_gpio *gpio = spi_get_drvdata(spi);

gpiochip_remove(&gpio->chip);

mutex_destroy(&gpio->lock);

return 0;
}

static const struct spi_device_id pisosr_gpio_id_table[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-abt-y030xx067a.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,13 @@ static int y030xx067a_probe(struct spi_device *spi)
return 0;
}

static int y030xx067a_remove(struct spi_device *spi)
static void y030xx067a_remove(struct spi_device *spi)
{
struct y030xx067a *priv = spi_get_drvdata(spi);

drm_panel_remove(&priv->panel);
drm_panel_disable(&priv->panel);
drm_panel_unprepare(&priv->panel);

return 0;
}

static const struct drm_display_mode y030xx067a_modes[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-ilitek-ili9322.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,14 +896,12 @@ static int ili9322_probe(struct spi_device *spi)
return 0;
}

static int ili9322_remove(struct spi_device *spi)
static void ili9322_remove(struct spi_device *spi)
{
struct ili9322 *ili = spi_get_drvdata(spi);

ili9322_power_off(ili);
drm_panel_remove(&ili->panel);

return 0;
}

/*
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/panel/panel-ilitek-ili9341.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static int ili9341_probe(struct spi_device *spi)
return -1;
}

static int ili9341_remove(struct spi_device *spi)
static void ili9341_remove(struct spi_device *spi)
{
const struct spi_device_id *id = spi_get_device_id(spi);
struct ili9341 *ili = spi_get_drvdata(spi);
Expand All @@ -741,7 +741,6 @@ static int ili9341_remove(struct spi_device *spi)
drm_dev_unplug(drm);
drm_atomic_helper_shutdown(drm);
}
return 0;
}

static void ili9341_shutdown(struct spi_device *spi)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-innolux-ej030na.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,13 @@ static int ej030na_probe(struct spi_device *spi)
return 0;
}

static int ej030na_remove(struct spi_device *spi)
static void ej030na_remove(struct spi_device *spi)
{
struct ej030na *priv = spi_get_drvdata(spi);

drm_panel_remove(&priv->panel);
drm_panel_disable(&priv->panel);
drm_panel_unprepare(&priv->panel);

return 0;
}

static const struct drm_display_mode ej030na_modes[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-lg-lb035q02.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,12 @@ static int lb035q02_probe(struct spi_device *spi)
return 0;
}

static int lb035q02_remove(struct spi_device *spi)
static void lb035q02_remove(struct spi_device *spi)
{
struct lb035q02_device *lcd = spi_get_drvdata(spi);

drm_panel_remove(&lcd->panel);
drm_panel_disable(&lcd->panel);

return 0;
}

static const struct of_device_id lb035q02_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-lg-lg4573.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,12 @@ static int lg4573_probe(struct spi_device *spi)
return 0;
}

static int lg4573_remove(struct spi_device *spi)
static void lg4573_remove(struct spi_device *spi)
{
struct lg4573 *ctx = spi_get_drvdata(spi);

lg4573_display_off(ctx);
drm_panel_remove(&ctx->panel);

return 0;
}

static const struct of_device_id lg4573_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,13 @@ static int nl8048_probe(struct spi_device *spi)
return 0;
}

static int nl8048_remove(struct spi_device *spi)
static void nl8048_remove(struct spi_device *spi)
{
struct nl8048_panel *lcd = spi_get_drvdata(spi);

drm_panel_remove(&lcd->panel);
drm_panel_disable(&lcd->panel);
drm_panel_unprepare(&lcd->panel);

return 0;
}

static const struct of_device_id nl8048_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-novatek-nt39016.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,14 @@ static int nt39016_probe(struct spi_device *spi)
return 0;
}

static int nt39016_remove(struct spi_device *spi)
static void nt39016_remove(struct spi_device *spi)
{
struct nt39016 *panel = spi_get_drvdata(spi);

drm_panel_remove(&panel->drm_panel);

nt39016_disable(&panel->drm_panel);
nt39016_unprepare(&panel->drm_panel);

return 0;
}

static const struct drm_display_mode kd035g6_display_modes[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/panel/panel-samsung-db7430.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,11 @@ static int db7430_probe(struct spi_device *spi)
return 0;
}

static int db7430_remove(struct spi_device *spi)
static void db7430_remove(struct spi_device *spi)
{
struct db7430 *db = spi_get_drvdata(spi);

drm_panel_remove(&db->panel);
return 0;
}

/*
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-samsung-ld9040.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,12 @@ static int ld9040_probe(struct spi_device *spi)
return 0;
}

static int ld9040_remove(struct spi_device *spi)
static void ld9040_remove(struct spi_device *spi)
{
struct ld9040 *ctx = spi_get_drvdata(spi);

ld9040_power_off(ctx);
drm_panel_remove(&ctx->panel);

return 0;
}

static const struct of_device_id ld9040_of_match[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/panel/panel-samsung-s6d27a1.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,11 @@ static int s6d27a1_probe(struct spi_device *spi)
return 0;
}

static int s6d27a1_remove(struct spi_device *spi)
static void s6d27a1_remove(struct spi_device *spi)
{
struct s6d27a1 *ctx = spi_get_drvdata(spi);

drm_panel_remove(&ctx->panel);
return 0;
}

static const struct of_device_id s6d27a1_match[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ static int s6e63m0_spi_probe(struct spi_device *spi)
s6e63m0_spi_dcs_write, false);
}

static int s6e63m0_spi_remove(struct spi_device *spi)
static void s6e63m0_spi_remove(struct spi_device *spi)
{
s6e63m0_remove(&spi->dev);
return 0;
}

static const struct of_device_id s6e63m0_spi_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-sitronix-st7789v.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,11 @@ static int st7789v_probe(struct spi_device *spi)
return 0;
}

static int st7789v_remove(struct spi_device *spi)
static void st7789v_remove(struct spi_device *spi)
{
struct st7789v *ctx = spi_get_drvdata(spi);

drm_panel_remove(&ctx->panel);

return 0;
}

static const struct of_device_id st7789v_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-sony-acx565akm.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static int acx565akm_probe(struct spi_device *spi)
return 0;
}

static int acx565akm_remove(struct spi_device *spi)
static void acx565akm_remove(struct spi_device *spi)
{
struct acx565akm_panel *lcd = spi_get_drvdata(spi);

Expand All @@ -666,8 +666,6 @@ static int acx565akm_remove(struct spi_device *spi)

drm_panel_disable(&lcd->panel);
drm_panel_unprepare(&lcd->panel);

return 0;
}

static const struct of_device_id acx565akm_of_match[] = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,13 @@ static int td028ttec1_probe(struct spi_device *spi)
return 0;
}

static int td028ttec1_remove(struct spi_device *spi)
static void td028ttec1_remove(struct spi_device *spi)
{
struct td028ttec1_panel *lcd = spi_get_drvdata(spi);

drm_panel_remove(&lcd->panel);
drm_panel_disable(&lcd->panel);
drm_panel_unprepare(&lcd->panel);

return 0;
}

static const struct of_device_id td028ttec1_of_match[] = {
Expand Down
Loading

0 comments on commit a0386bb

Please sign in to comment.