mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/mmc/core/bus: Delete redundant match function
@ 2021-12-06 16:50 lizhe
  2021-12-07  7:23 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: lizhe @ 2021-12-06 16:50 UTC (permalink / raw)
  To: ulf.hansson, u.kleine-koenig, srinivas.pandruvada, pali,
	TheSven73, lznuaa, sensor1010
  Cc: linux-mmc, linux-kernel

	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@163.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/mmc/core/bus: Delete redundant match function
  2021-12-06 16:50 [PATCH] drivers/mmc/core/bus: Delete redundant match function lizhe
@ 2021-12-07  7:23 ` Uwe Kleine-König
       [not found]   ` <2447b32c.1d53.186fa5703d8.Coremail.sensor1010@163.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2021-12-07  7:23 UTC (permalink / raw)
  To: lizhe
  Cc: ulf.hansson, srinivas.pandruvada, pali, TheSven73, lznuaa,
	linux-mmc, linux-kernel, kernel

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

Hello,

On Mon, Dec 06, 2021 at 08:50:38AM -0800, lizhe wrote:
> 	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.

s/arae/are/, but maybe the overall wording could be improved. Something
like:

	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.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/mmc/core/bus: Delete redundant match function
       [not found]   ` <2447b32c.1d53.186fa5703d8.Coremail.sensor1010@163.com>
@ 2023-03-19 16:37     ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2023-03-19 16:37 UTC (permalink / raw)
  To: lizhe
  Cc: TheSven73, ulf.hansson, fthain, linux-mmc, linux-kernel,
	linux-m68k, kernel, srinivas.pandruvada, lznuaa, pali

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

Hello Lizhe,

On Sun, Mar 19, 2023 at 10:47:32PM +0800, lizhe wrote:
> HI : u.kleine-koenig
>     1. 
>     This is the earliest submission record for this patch.
>     you were also involved and gave good advice. 
> 
> 
>     2. 
>    in may 2022,  i submitted the pach again.
> 
> 
>    i discovered and submitted this issue twice.
>    i did the discovery and submission.
> 
> 
>   please consider receiving my patch. thanks.

it's unclear to me, why you address me here. For the patch under
discussion it's not me who is responsible to judge and apply your patch.

If you check the output of

	scripts/get_maintainer.pl -f drivers/mmc/core/bus.c 

you'll see that Ulf Hansson is the right one to nag.

Best regards
Uwe


-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-19 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 16:50 [PATCH] drivers/mmc/core/bus: Delete redundant match function lizhe
2021-12-07  7:23 ` Uwe Kleine-König
     [not found]   ` <2447b32c.1d53.186fa5703d8.Coremail.sensor1010@163.com>
2023-03-19 16:37     ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®