Commit 6d247e4d authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Michael Ellerman
Browse files

powerpc/ps3: make system bus's remove and shutdown callbacks return void



The driver core ignores the return value of struct device_driver::remove
because there is only little that can be done. For the shutdown callback
it's ps3_system_bus_shutdown() which ignores the return value.

To simplify the quest to make struct device_driver::remove return void,
let struct ps3_system_bus_driver::remove return void, too. All users
already unconditionally return 0, this commit makes it obvious that
returning an error code is a bad idea and ensures future users behave
accordingly.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201126165950.2554997-2-u.kleine-koenig@pengutronix.de
parent 7ff94669
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -378,8 +378,8 @@ struct ps3_system_bus_driver {
	enum ps3_match_sub_id match_sub_id;
	struct device_driver core;
	int (*probe)(struct ps3_system_bus_device *);
	int (*remove)(struct ps3_system_bus_device *);
	int (*shutdown)(struct ps3_system_bus_device *);
	void (*remove)(struct ps3_system_bus_device *);
	void (*shutdown)(struct ps3_system_bus_device *);
/*	int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */
/*	int (*resume)(struct ps3_system_bus_device *); */
};
+2 −3
Original line number Diff line number Diff line
@@ -382,7 +382,6 @@ static int ps3_system_bus_probe(struct device *_dev)

static int ps3_system_bus_remove(struct device *_dev)
{
	int result = 0;
	struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
	struct ps3_system_bus_driver *drv;

@@ -393,13 +392,13 @@ static int ps3_system_bus_remove(struct device *_dev)
	BUG_ON(!drv);

	if (drv->remove)
		result = drv->remove(dev);
		drv->remove(dev);
	else
		dev_dbg(&dev->core, "%s:%d %s: no remove method\n",
			__func__, __LINE__, drv->core.name);

	pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
	return result;
	return 0;
}

static void ps3_system_bus_shutdown(struct device *_dev)
+1 −2
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ fail:
	return error;
}

static int ps3disk_remove(struct ps3_system_bus_device *_dev)
static void ps3disk_remove(struct ps3_system_bus_device *_dev)
{
	struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
	struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
@@ -526,7 +526,6 @@ static int ps3disk_remove(struct ps3_system_bus_device *_dev)
	kfree(dev->bounce_buf);
	kfree(priv);
	ps3_system_bus_set_drvdata(_dev, NULL);
	return 0;
}

static struct ps3_system_bus_driver ps3disk = {
+1 −2
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ fail:
	return error;
}

static int ps3vram_remove(struct ps3_system_bus_device *dev)
static void ps3vram_remove(struct ps3_system_bus_device *dev)
{
	struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);

@@ -817,7 +817,6 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev)
	free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
	kfree(priv);
	ps3_system_bus_set_drvdata(dev, NULL);
	return 0;
}

static struct ps3_system_bus_driver ps3vram = {
+1 −2
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ fail:
	return error;
}

static int ps3flash_remove(struct ps3_system_bus_device *_dev)
static void ps3flash_remove(struct ps3_system_bus_device *_dev)
{
	struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);

@@ -413,7 +413,6 @@ static int ps3flash_remove(struct ps3_system_bus_device *_dev)
	kfree(ps3_system_bus_get_drvdata(&dev->sbd));
	ps3_system_bus_set_drvdata(&dev->sbd, NULL);
	ps3flash_dev = NULL;
	return 0;
}


Loading