Commit 3fd269e7 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Uwe Kleine-König
Browse files

amba: Make the remove callback return void



All amba drivers return 0 in their remove callback. Together with the
driver core ignoring the return value anyhow, it doesn't make sense to
return a value here.

Change the remove prototype to return void, which makes it explicit that
returning an error value doesn't work as expected. This simplifies changing
the core remove callback to return void, too.

Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org> # for drivers/memory
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com> # for hwtracing/coresight
Acked-By: Vinod Koul <vkoul@kernel.org> # for dmaengine
Acked-by: Guenter Roeck <linux@roeck-us.net> # for watchdog
Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C
Acked-by: Takashi Iwai <tiwai@suse.de> # for sound
Acked-by: Vladimir Zapolskiy <vz@mleia.com> # for memory/pl172
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210126165835.687514-5-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 5b495ac8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -300,11 +300,10 @@ static int amba_remove(struct device *dev)
{
	struct amba_device *pcdev = to_amba_device(dev);
	struct amba_driver *drv = to_amba_driver(dev->driver);
	int ret = 0;

	pm_runtime_get_sync(dev);
	if (drv->remove)
		ret = drv->remove(pcdev);
		drv->remove(pcdev);
	pm_runtime_put_noidle(dev);

	/* Undo the runtime PM settings in amba_probe() */
@@ -315,7 +314,7 @@ static int amba_remove(struct device *dev)
	amba_put_disable_pclk(pcdev);
	dev_pm_domain_detach(dev, true);

	return ret;
	return 0;
}

static void amba_shutdown(struct device *dev)
+1 −2
Original line number Diff line number Diff line
@@ -69,11 +69,10 @@ static int nmk_rng_probe(struct amba_device *dev, const struct amba_id *id)
	return ret;
}

static int nmk_rng_remove(struct amba_device *dev)
static void nmk_rng_remove(struct amba_device *dev)
{
	amba_release_regions(dev);
	clk_disable(rng_clk);
	return 0;
}

static const struct amba_id nmk_rng_ids[] = {
+1 −2
Original line number Diff line number Diff line
@@ -3195,7 +3195,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
	return ret;
}

static int pl330_remove(struct amba_device *adev)
static void pl330_remove(struct amba_device *adev)
{
	struct pl330_dmac *pl330 = amba_get_drvdata(adev);
	struct dma_pl330_chan *pch, *_p;
@@ -3235,7 +3235,6 @@ static int pl330_remove(struct amba_device *adev)

	if (pl330->rstc)
		reset_control_assert(pl330->rstc);
	return 0;
}

static const struct amba_id pl330_ids[] = {
+1 −3
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
	return ret;
}

static int pl111_amba_remove(struct amba_device *amba_dev)
static void pl111_amba_remove(struct amba_device *amba_dev)
{
	struct device *dev = &amba_dev->dev;
	struct drm_device *drm = amba_get_drvdata(amba_dev);
@@ -331,8 +331,6 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
		drm_panel_bridge_remove(priv->bridge);
	drm_dev_put(drm);
	of_reserved_mem_device_release(dev);

	return 0;
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -567,12 +567,11 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id)
	return ret;
}

static int catu_remove(struct amba_device *adev)
static void catu_remove(struct amba_device *adev)
{
	struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev);

	coresight_unregister(drvdata->csdev);
	return 0;
}

static struct amba_id catu_ids[] = {
Loading