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: 9367979 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 1819460487 for ; Sat, 8 Oct 2016 04:23:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 015FD29897 for ; Sat, 8 Oct 2016 04:23:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA5CB298AD; Sat, 8 Oct 2016 04:23:53 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF05229897 for ; Sat, 8 Oct 2016 04:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114AbcJHEXu (ORCPT ); Sat, 8 Oct 2016 00:23:50 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:36534 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbcJHEXY (ORCPT ); Sat, 8 Oct 2016 00:23:24 -0400 Received: by mail-pf0-f179.google.com with SMTP id i85so31715782pfa.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=iWsrKo+bPPGQJY3m06kqnwqFX0NVgI+g1/19mUJe11ix7pVsABCRJQhtB9/MiGqrGj ouZFG7ANd+e16KfMc6DPr5x3ez8RNkiG/10m+sUJuD2gO9iVykx06pD1FOhekA1mKcXO 9Q51R3APh9pCcMT1G6CS60hsOWdfM6qMU4GLQthrS9etyGrb+5si+dLKn+eooHVQUtm7 zldoNsIwYDd2vvT/EKT9uEpxkUKeNvzR4yv8/fAaLlFP0YLH1DOUGW3Vx+kKDvb8rPYH f+tJXDqTCQrqguMEYogfU6Ujx4Qm36RPnuGutg6yusN+oscxsTUILQe6H/EkWU2BDUIa wjLQ== X-Gm-Message-State: AA6/9RmAv2v+aK0RSi+pblP8svljspXPhPh0QwKwkSZVc1l5bZDkPCLAK07p+vtUa+O+p946 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-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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;