From patchwork Sat Oct 8 04:23:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 77374 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp501214qge; Fri, 7 Oct 2016 21:23:31 -0700 (PDT) X-Received: by 10.98.105.130 with SMTP id e124mr22424290pfc.27.1475900611657; Fri, 07 Oct 2016 21:23:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qo5si15428502pac.61.2016.10.07.21.23.31; Fri, 07 Oct 2016 21:23:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; 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-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbcJHEX3 (ORCPT + 9 others); Sat, 8 Oct 2016 00:23:29 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36534 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbcJHEXY (ORCPT ); Sat, 8 Oct 2016 00:23:24 -0400 Received: by mail-pf0-f178.google.com with SMTP id i85so31715781pfa.3 for ; Fri, 07 Oct 2016 21:23: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=YN09Ug8DR5fg13cFqw65+hF+Z6nLFCdTkcfQiYzTUsE=; b=StUL31wWwPg4f94rNjjS8X+WrcNQ1Wp7uEn8F/DaSrUprKhv6T0xmAO052Km87bzIr tnNwXJ79hfyd+TohusLnKjIf9VwaktQt6dqvAxtpDnzogQfp1fJR4xmPRKhIxEIXrCzU KLnrar7V4n0dv6fBO31RjiRiTt/99eGWTq1Qo= 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=YN09Ug8DR5fg13cFqw65+hF+Z6nLFCdTkcfQiYzTUsE=; b=BnVqMnHJHzNlIrbKp+DlaIUWtLQp2cBacMswKJ1USoPCkXwK0zID5hVN4e42ofQt9i YgInSIrVl//DkufQYKnyq8HEuhPd3uo1dKuni/GJvshcXSyYQG7WLdeK/7YheSpaHbYF QCqCMMos+iFt1BwRB52+kqSfGlM42lTGie4GCIgrNxxTCdYnfJzzcPDkw9PTR8FN3dWf YPxEII0gum9krAjGiWqU17wr7OPTIHcvd7KmFsyGBu9k6LWmJw0F8JdXc6Hnw8Rr914M O3LQG3i/BA9hzRyGJEaufYy2pVGbAN64ZSkBnA7ytccfvMcpT2wgqgqR/XomQEu404HM So5Q== X-Gm-Message-State: AA6/9RnMy8u+/i+TL7S3YELNs1q5EM3VXCkaSZgwRik1uEP6Yxt78YUZdaOKR+5dFkqqe5ib X-Received: by 10.98.12.4 with SMTP id u4mr24830355pfi.80.1475900603607; Fri, 07 Oct 2016 21:23:23 -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 t67sm17537506pfd.32.2016.10.07.21.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Oct 2016 21:23:21 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: Jonathan Corbet , Linus Walleij , Marek Novak , Matteo Sartori , Michal Simek , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/5] rpmsg: Introduce a driver override mechanism Date: Fri, 7 Oct 2016 21:23:12 -0700 Message-Id: <1475900595-8375-2-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1475900595-8375-1-git-send-email-bjorn.andersson@linaro.org> References: <1475900595-8375-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Similar to other subsystems it's useful to provide a mechanism to force a specific driver match on a device, so introduce this. Signed-off-by: Bjorn Andersson --- drivers/rpmsg/rpmsg_core.c | 3 +++ include/linux/rpmsg.h | 2 ++ 2 files changed, 5 insertions(+) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index b6ea9ffa7381..087d4db896c8 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -315,6 +315,9 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv) const struct rpmsg_device_id *ids = rpdrv->id_table; unsigned int i; + if (rpdev->driver_override) + return !strcmp(rpdev->driver_override, drv->name); + if (ids) for (i = 0; ids[i].name[0]; i++) if (rpmsg_id_match(rpdev, &ids[i])) diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h index 452d393cc8dd..7ad6c205f110 100644 --- a/include/linux/rpmsg.h +++ b/include/linux/rpmsg.h @@ -64,6 +64,7 @@ struct rpmsg_channel_info { * rpmsg_device - device that belong to the rpmsg bus * @dev: the device struct * @id: device id (used to match between rpmsg drivers and devices) + * @driver_override: driver name to force a match * @src: local address * @dst: destination address * @ept: the rpmsg endpoint of this channel @@ -72,6 +73,7 @@ struct rpmsg_channel_info { struct rpmsg_device { struct device dev; struct rpmsg_device_id id; + char *driver_override; u32 src; u32 dst; struct rpmsg_endpoint *ept;