From patchwork Tue Aug 16 00:17:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9282387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC0FD600CB for ; Tue, 16 Aug 2016 00:19:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC9FE28DCB for ; Tue, 16 Aug 2016 00:19:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B18A928E03; Tue, 16 Aug 2016 00:19:25 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B438428E8F for ; Tue, 16 Aug 2016 00:19:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZS56-0003gG-EI; Tue, 16 Aug 2016 00:18:12 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZS4f-0003Q2-Hq for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2016 00:17:47 +0000 Received: by mail-pf0-x230.google.com with SMTP id x72so21366866pfd.2 for ; Mon, 15 Aug 2016 17:17:24 -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=jLlsOeb1jaZM9naNp2755b1Ro5pGncKcRk79iJUnBZM=; b=SECmO9cI3gSFjMQhBoo40k1mQfNBlhIcqrBzsFQFTnl1fae+5NXxfm8u2LSLpOG27U FbxvyAqjn6jv7if6O2vzmc5Q6ECdfZpYhOF0X4wC67/HoC5NYyGfsEcK/DUOeIrbVwSW PLh6RocuULnrCbIKshoOh4qua22JNbssIUA8E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jLlsOeb1jaZM9naNp2755b1Ro5pGncKcRk79iJUnBZM=; b=jdWUm6yTeuh+ObTzjQaOvkEKSHJkbUhY7FYrbOe7zv/fgUIGAZvWdpjncH9U8ZzAHy gM6rQtZ5Rrreklj+rxftTm5MUFul2RBBY+NBNJTxQtiIC2/G7ZDkJ7GQbZGasV0FkFKf MntcyuVd/Bbpl2J6cTobLKXbTDrmiUPc4hXuIQfV5rCKn2dw7W5ZOD2NjHH7eB3dv2bl B3wFAMOxbzgqnbGpTNFirzSIL0TmMxZvn2lfL7zVobKZo/DFQPEC0Mk6vISlYg72gczK m6LBh38ABJc6PwZvcJ2pFfhAEPOP9g0UuzFotoPdB8PK2+eyqWHuhU4EfTjUKVOWkXeq kjNw== X-Gm-Message-State: AEkoouuWRsvLE1SanfsH1sm6DLkk8ckDNfrt+L2Wi9KI4cArRTGgOfVejUmouoZ7/XhM7hCw X-Received: by 10.98.60.217 with SMTP id b86mr6571716pfk.129.1471306644508; Mon, 15 Aug 2016 17:17:24 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id p187sm34047931pfb.5.2016.08.15.17.17.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Aug 2016 17:17:23 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Subject: [PATCH 01/14] rpmsg: Enable matching devices with drivers based on DT Date: Mon, 15 Aug 2016 17:17:07 -0700 Message-Id: <1471306640-29917-2-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1471306640-29917-1-git-send-email-bjorn.andersson@linaro.org> References: <1471306640-29917-1-git-send-email-bjorn.andersson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160815_171745_705572_633AE805 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Make it possible to match rpmsg devices based on device tree node, in addition to the id table. In some of these cases the rpmsg driver would not have a id_table, so make this optional. Signed-off-by: Bjorn Andersson --- drivers/rpmsg/virtio_rpmsg_bus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 4a4374cc6a59..495fa0a282d3 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -33,6 +33,7 @@ #include #include #include +#include /** * struct virtproc_info - virtual remote processor state @@ -175,11 +176,12 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv) const struct rpmsg_device_id *ids = rpdrv->id_table; unsigned int i; - for (i = 0; ids[i].name[0]; i++) - if (rpmsg_id_match(rpdev, &ids[i])) - return 1; + if (ids) + for (i = 0; ids[i].name[0]; i++) + if (rpmsg_id_match(rpdev, &ids[i])) + return 1; - return 0; + return of_driver_match_device(dev, drv); } static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env)