From patchwork Sun Sep 16 23:45:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10601925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE8D915A6 for ; Sun, 16 Sep 2018 23:46:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDAD929340 for ; Sun, 16 Sep 2018 23:46:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B18232934C; Sun, 16 Sep 2018 23:46:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0181B29340 for ; Sun, 16 Sep 2018 23:46:29 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 648A426788B; Mon, 17 Sep 2018 01:46:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 19062267819; Mon, 17 Sep 2018 01:46:03 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by alsa0.perex.cz (Postfix) with ESMTP id 6B089267809 for ; Mon, 17 Sep 2018 01:46:01 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id n18-v6so10035788ioa.9 for ; Sun, 16 Sep 2018 16:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jDArbQdVww+YSgUKwhIereZD0KDuIxo3XfjQo0Dfyoc=; b=MtSqOS63VH9yjjal86E/bgA2jgcaxL1KyQEcQ7/F7RLWZQ3Y1vZYGZoRUlLEor0FtB B6NLZCup0miL/UXfeOOAOdN/KrAPoV8JC1Nb17n08wPxnp4wjzmvxb4IvR4/BwDet5BJ dyScJ5A5M08ju3b2Si9t6v5eNJAi6WUH1Y8+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jDArbQdVww+YSgUKwhIereZD0KDuIxo3XfjQo0Dfyoc=; b=TKdT+DEFuvUTW4B6MbY8its0NpvyWbGyuLK4mO2uMxlsYdVrsiCmN2OiFKqUQS+UdK TEzylAEizT0LomEplk6s8BPp/efLBG/w40Nx+ds3OFVWA5BdSfAeKcCbOBYWjdpBfjCx vpH31VCsIXbDsTFy8oM5RRgMBXNxryllietNf/sd5XV7rHl/wP8UACakQ5NjKMsk1oJm Hsw5oLRDM21QqvlkBEV18JVflOltG+a3E9XEQBGJHNRmjvIe58QwURtoPS6cA82qT8VB sQqdpxLWU3QPEannKX9uGHvPejZ4Jhwj2onSxNTANaczVxIG4vEMZ14zHsX+Hu7TMmBV SreA== X-Gm-Message-State: APzg51AK6pDVcIqVKUddElAcRRWWugVS7jc/JGIhpChdJRK2lupK9j4m vEVQB9fTHZTY8Z4gEHxSORi8dGTVtgo= X-Google-Smtp-Source: ANB0VdbTnWOE3EInvMGSi/nCkv1qhWUH1lfh56XEx0Lnwzysok6QZBT5reM0nGV10mZQLwOt7KHbHg== X-Received: by 2002:a6b:c694:: with SMTP id w142-v6mr17833891iof.142.1537141560397; Sun, 16 Sep 2018 16:46:00 -0700 (PDT) Received: from localhost.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id a11-v6sm4495177ioc.63.2018.09.16.16.45.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Sep 2018 16:45:59 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Date: Sun, 16 Sep 2018 16:45:42 -0700 Message-Id: <20180916234546.29661-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180916234546.29661-1-srinivas.kandagatla@linaro.org> References: <20180916234546.29661-1-srinivas.kandagatla@linaro.org> Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, broonie@kernel.org, Srinivas Kandagatla Subject: [alsa-devel] [PATCH 3/7] slimbus: core: match device tree based devices correctly X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla device_id for device tree based devices come from dt compatible string, such drivers need not provide non dt style device id table. Match those device using compatible strings. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 262591f..55eda58 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -33,6 +33,10 @@ static int slim_device_match(struct device *dev, struct device_driver *drv) struct slim_device *sbdev = to_slim_device(dev); struct slim_driver *sbdrv = to_slim_driver(drv); + /* Attempt an OF style match first */ + if (of_driver_match_device(dev, drv)) + return 1; + return !!slim_match(sbdrv->id_table, sbdev); } @@ -106,7 +110,7 @@ EXPORT_SYMBOL_GPL(slimbus_bus); int __slim_driver_register(struct slim_driver *drv, struct module *owner) { /* ID table and probe are mandatory */ - if (!drv->id_table || !drv->probe) + if (!(drv->driver.of_match_table || drv->id_table) || !drv->probe) return -EINVAL; drv->driver.bus = &slimbus_bus;