Skip to contentSkip to conversation

"Driver 'mmcblk' needs updating - please use bus_type methods"

DISCUSSION Minchev, Todor 2 participants 2 messages Feb 18, 2015 – Mar 3, 2015 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

This has probably been reported already.

In 3.19 this started showing up in the dmesg log when the mmcblk driver gets loaded:

"Driver 'mmcblk' needs updating - please use bus_type methods"

Looks like it is caused by the re-factoring needed after the removal of struct mmc_driver. Both the mmc bus and the block driver register a shutdown and the two fail the driver_register sanity check resulting in the warning above.

Thanks,

Todor

#1 lore raw
Quoted 11 lines

This has probably been reported already.

In 3.19 this started showing up in the dmesg log when the mmcblk driver gets loaded:

"Driver 'mmcblk' needs updating - please use bus_type methods"

Looks like it is caused by the re-factoring needed after the removal of struct mmc_driver. Both the mmc bus and the block driver register a shutdown and the two fail the driver_register sanity check resulting in the warning above.

I've also run into this recently and failed to come up with any elegant solution. Of course the warning could be safely ignored, but it doesn't seem right in the long run.

Something similar to removed mmc_driver really seems to be the best solution here. Otherwise, the following workaround is probably the simplest one, but as for me it is too ugly to submit it seriously.

---

drivers/mmc/card/block.c +9 -1
index c69afb5..6355df1 100644
@@ -2546,7 +2546,6 @@ static struct device_driver mmc_driver = {
 	.pm		= &mmc_blk_pm_ops,
 	.probe		= mmc_blk_probe,
 	.remove		= mmc_blk_remove,
-	.shutdown	= mmc_blk_shutdown,
 };
 
 static int __init mmc_blk_init(void)
@@ -2566,6 +2565,15 @@ static int __init mmc_blk_init(void)
 	if (res)
 		goto out2;
 
+	/*
+	 * device_shutdown() calls bus_ops ->shutdown() if it's present
+	 * and falls back to device_driver ->shutdown() if it's not. This
+	 * motivates existence of a sanity check in driver_register() against
+	 * both ops being set at the same time. Work around this check
+	 * with deferred setting of device_driver ->shutdown().
+	 */
+	mmc_driver.shutdown = mmc_blk_shutdown;
+
 	return 0;
  out2:
 	unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");