platform: fall-back to driver name check if there is no id found
PATCH 1/1 platform: fall-back to driver name check if there is no id found
Some of the platform devices rely on the name of their driver to match with. In the current implementation, if platform id table is needed, they have to add the name to the platform id table which sounds alogical. The patch adjustes the logic of the id table matching to make sure we will fall-back to match by the driver name. This will make it similar to the DT or ACPI cases.
Signed-off-by Andy Shevchenko <[email protected]>
Reported-by Mika Westerberg <[email protected]>
Cc Eric Miao <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
--- drivers/base/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/platform.c +2 -2
@@ -732,8 +732,8 @@ static int platform_match(struct device *dev, struct device_driver *drv)return 1 ;/* Then try to match against the id table */ -if (pdrv->id_table) -return platform_match_id (pdrv->id_table, pdev) !=NULL ; +if (pdrv->id_table &&platform_match_id (pdrv->id_table, pdev)) +return 1 ;/* fall-back to driver name match */ return (strcmp (pdev->name, drv->name) ==0 );
Signature · 1 line
1.7.10.4