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: 73946 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1712172qga; Mon, 15 Aug 2016 17:19:06 -0700 (PDT) X-Received: by 10.98.134.77 with SMTP id x74mr59018696pfd.21.1471306746004; Mon, 15 Aug 2016 17:19:06 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q2si28989900pfb.213.2016.08.15.17.19.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 17:19:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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+patch=linaro.org@lists.infradead.org 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(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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)