From patchwork Thu Sep 1 22:27:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 75252 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp536864qga; Thu, 1 Sep 2016 15:30:26 -0700 (PDT) X-Received: by 10.66.220.194 with SMTP id py2mr30695770pac.77.1472769025203; Thu, 01 Sep 2016 15:30:25 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l71si7676600pfi.232.2016.09.01.15.30.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 15:30:25 -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 1bfaTP-0002P1-4H; Thu, 01 Sep 2016 22:28:39 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfaTK-0002Dc-1n for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2016 22:28:35 +0000 Received: by mail-pa0-x22c.google.com with SMTP id cy9so33875927pac.0 for ; Thu, 01 Sep 2016 15:28:14 -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=nWqTYDmdyGditq9gYTeGfugpiDjcJm/XsB777HRdB8c=; b=kYaeuaU1tvBADI7xqqhyOusk+4tsJc9Lg+eKfFcLQM90GtrqsCe67UN66NJPHdmRBo Lgfv9g16iRvYAuC3qShdBIWvY401Hnq6oIWHy4QX5CqJ+i/2oBuonb+ijs4g42gh+n70 z3bbBsJXzjv/s+gbMlOQDOS6gc3XPQPvdgl2c= 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=nWqTYDmdyGditq9gYTeGfugpiDjcJm/XsB777HRdB8c=; b=lsgge7wEgbaV55JWeGECFo4KXfGa1/m1b/rzkIcFdalmF55wrNOfIW175LDwWuSj8j DOg7n7GMHTrZWLI+NPla56ssZp4IuHpHq0I24JB/pW667eqnJhHc2na3AKAV+9CEKtOU X4t9DQo3cEwo6YkSVCIVeBVeAoeYM1xuuralCmsb37LW2fPIJhGFLQdnrLpF5hslH1KZ DYN/799gPwLAYbOlMCf1kwecCVA3l3I/hiuGjm9OqfyVNmcxzdl8OMk7PZyD1SNlszuC 1Uxisu7rkRL/MsyMpC2jmOJ685vF43qWmbgC3KxYbo+qPCIuAct8mlACht7brctMAf+j ilKQ== X-Gm-Message-State: AE9vXwPnmCQZ16BNfg9fdSEMXNgWQg0Q5RsQWuG93iz0mFVfEsvXvQhfMpdisawDd4iJMTCc X-Received: by 10.66.253.7 with SMTP id zw7mr30561249pac.25.1472768893696; Thu, 01 Sep 2016 15:28:13 -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 iw10sm8887131pac.14.2016.09.01.15.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 15:28:13 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Subject: [PATCH v2 01/17] rpmsg: Enable matching devices with drivers based on DT Date: Thu, 1 Sep 2016 15:27:53 -0700 Message-Id: <1472768889-3906-2-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> References: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160901_152834_213244_435240CB X-CRM114-Status: GOOD ( 15.17 ) 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:c03:0:0:0:22c 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 --- Changes since v1: - None 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)