[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211206165038.123107-1-sensor1010@163.com>
Date: Mon, 6 Dec 2021 08:50:38 -0800
From: lizhe <sensor1010@....com>
To: ulf.hansson@...aro.org, u.kleine-koenig@...gutronix.de,
srinivas.pandruvada@...ux.intel.com, pali@...nel.org,
TheSven73@...il.com, lznuaa@...il.com, sensor1010@....com
Cc: linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/mmc/core/bus: Delete redundant match function
When the device and device driver are matching,
if the device or the bus to which the device driver belongs
does not provide a match function,
then the device and device driver arae matched by default.
function 'driver_match_device' illustrates this mechanism,
because the return value of 'mmc_bus_match' is 1,
even if this function is not provided, the function
'driver_match_device' still returns 1,
so function 'mmc_bus_match' is redundant.
Signed-off-by: lizhe <sensor1010@....com>
---
drivers/mmc/core/bus.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index f6b7a9c5bbff..096ae624be9a 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -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
Powered by blists - more mailing lists