lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1360573299-4886-1-git-send-email-andriy.shevchenko@linux.intel.com>
Date:	Mon, 11 Feb 2013 11:01:39 +0200
From:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	linux-kernel@...r.kernel.org
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Eric Miao <eric.y.miao@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH, resend] 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 <andriy.shevchenko@...ux.intel.com>
Reported-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Eric Miao <eric.y.miao@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/base/platform.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index c0b8df3..452ba4b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -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);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ