Skip to content

Commit b4a0de2

Browse files
Uwe Kleine-Königmiquelraynal
Uwe Kleine-König
authored andcommitted
mtd: sst25l: Warn about failure to unregister mtd device
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 5765f4e commit b4a0de2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/devices/sst25l.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ static int sst25l_remove(struct spi_device *spi)
402402
{
403403
struct sst25l_flash *flash = spi_get_drvdata(spi);
404404

405-
return mtd_device_unregister(&flash->mtd);
405+
WARN_ON(mtd_device_unregister(&flash->mtd));
406+
407+
return 0;
406408
}
407409

408410
static struct spi_driver sst25l_driver = {

0 commit comments

Comments
 (0)