public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Eric Miao <eric.miao@marvell.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH] platform: fall-back to driver name check if there is no id found
Date: Fri,  8 Feb 2013 17:24:44 +0200	[thread overview]
Message-ID: <1360337084-9901-1-git-send-email-andriy.shevchenko@linux.intel.com> (raw)

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@linux.intel.com>
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 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


             reply	other threads:[~2013-02-08 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 15:24 Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-04-19 12:35 [PATCH] platform: fall-back to driver name check if there is no id found Hein Tibosch
2013-04-19 13:17 ` Eric Miao
2013-04-19 13:20 ` Eric Miao
2013-04-19 14:44   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360337084-9901-1-git-send-email-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=eric.miao@marvell.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox