Skip to contentSkip to conversation

drivers/mmc/core/bus: Remove redundant driver match function

PATCH In review lizhe 3 participants 3 messages Dec 7, 2021 – Dec 9, 2021 MMC, SD and SDIO

lore
Share & tools
lore

lizhe

author
#0 lore raw

PATCH 1/1 drivers/mmc/core/bus: Remove redundant driver match function

If there is no driver match function, the driver core assumes that each candidate pair (driver, device) matches. See function driver_match_device().

Drop the mmc bus's match function that always returned 1 and so implements the same behaviour as when there is no match function.

---
 drivers/mmc/core/bus.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/mmc/core/bus.c +0 -11
index f6b7a9c5bbff..096ae624be9a 100644
@@ -53,16 +53,6 @@ static struct attribute *mmc_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(mmc_dev);
 
-/*
- * This currently matches any MMC driver to any MMC card - drivers
- * themselves make the decision whether to drive this card in their
- * probe method.
- */
-static int mmc_bus_match(struct device *dev, struct device_driver *drv)
-{
-	return 1;
-}
-
 static int
 mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
@@ -226,7 +216,6 @@ static const struct dev_pm_ops mmc_bus_pm_ops = {
 static struct bus_type mmc_bus_type = {
 	.name		= "mmc",
 	.dev_groups	= mmc_dev_groups,
-	.match		= mmc_bus_match,
 	.uevent		= mmc_bus_uevent,
 	.probe		= mmc_bus_probe,
 	.remove		= mmc_bus_remove,
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · lizhe

If there is no driver match function, the driver core assumes that each candidate pair (driver, device) matches. See function driver_match_device().

Drop the mmc bus's match function that always returned 1 and so implements the same behaviour as when there is no match function.

If you want to make it easier for maintainers to take your patches, consider using -v2 for git send-email (or git format-patch) the next time.

Best regards and thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#2 lore raw
In reply to lizhe
Quoted 10 lines · lizhe

If there is no driver match function, the driver core assumes that each candidate pair (driver, device) matches. See function driver_match_device().

Drop the mmc bus's match function that always returned 1 and so implements the same behaviour as when there is no match function.

Applied for next, thanks!

Kind regards
Uffe

Quoted 37 lines
---
 drivers/mmc/core/bus.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/mmc/core/bus.c +0 -12
index f6b7a9c5bbff..096ae624be9a 100644
@@ -53,16 +53,6 @@ static struct attribute *mmc_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(mmc_dev);
 
-/*
- * This currently matches any MMC driver to any MMC card - drivers
- * themselves make the decision whether to drive this card in their
- * probe method.
- */
-static int mmc_bus_match(struct device *dev, struct device_driver *drv)
-{
-       return 1;
-}
-
 static int
 mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
@@ -226,7 +216,6 @@ static const struct dev_pm_ops mmc_bus_pm_ops = {
 static struct bus_type mmc_bus_type = {
        .name           = "mmc",
        .dev_groups     = mmc_dev_groups,
-       .match          = mmc_bus_match,
        .uevent         = mmc_bus_uevent,
        .probe          = mmc_bus_probe,
        .remove         = mmc_bus_remove,
--

2.25.1