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: 9367991 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 93CFB60487 for ; Sat, 8 Oct 2016 04:25:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B48729781 for ; Sat, 8 Oct 2016 04:25:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D580298A5; Sat, 8 Oct 2016 04:25:49 +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 2703729781 for ; Sat, 8 Oct 2016 04:25:49 +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 1bsjB1-0001mA-MU; Sat, 08 Oct 2016 04:23:59 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bsjAm-0001gn-AK for linux-arm-kernel@lists.infradead.org; Sat, 08 Oct 2016 04:23:45 +0000 Received: by mail-pf0-x22a.google.com with SMTP id 190so31821903pfv.0 for ; Fri, 07 Oct 2016 21:23:23 -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=ORlylEUgtL7qh4/HRQ8gsSzgbtQQTMkls65opHL4VE9gMO1bfx+eR15mUz6sO5GmtR q2OkSOQxGhGiohK2ruc36SKSOis+TVYPK63X0+Eg/hQ19RLBHu27FWd0HW55Odqw6H4p ZgSMWH6Xdfe1PVvE0pAAHTnmHBCf3gtMAoB1f95UO+auoZOjRfdMq4qH2JLybY1FN8+Q ILcXhTgxXYd+QWZliy/Vq0pnS8Sp4mVfm5Q++fWxgsURHDuxofkiIj5a+bzWiyKSM43Z x8MMvCsY1s8UHSddvzIge7R3OjbjybBfD/ZZ2Ghxkbnc92Sur/i+eTKYdUbNpoSmdwET iGHg== X-Gm-Message-State: AA6/9RkCwbouGE6LbgJQlbD7QTYZIOQ5IiuYxWhdqekQv22eDP5zp77P/rF523iQl7RCAI3X 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161007_212344_404695_CAE55324 X-CRM114-Status: GOOD ( 13.43 ) 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: Michal Simek , linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Linus Walleij , Jonathan Corbet , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Novak , Matteo Sartori , 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 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;