From patchwork Wed Jun 28 18:48:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 106558 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp246014qge; Wed, 28 Jun 2017 11:48:40 -0700 (PDT) X-Received: by 10.99.107.136 with SMTP id g130mr12077330pgc.3.1498675720470; Wed, 28 Jun 2017 11:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498675720; cv=none; d=google.com; s=arc-20160816; b=hS4d8Nx13QETM/FJhHOb3SKs+WRU/LDJHp8RNg0cUAzdrt4YMO8Lkdflan7fcTgQ/n Vq/XJ5z+z9suKmc9aXH6eBFQ2V2THSAxmezMXQIXVpb/80VnvlFypbF0apMkBhvpeHAx cJjOqJwtLGi7f+6kSewTcp9ZWhc1Ktu4V+7J5EYdD/pXbPzNhAeGpp/KfT/dgd5dThVL 8Fpx4iCin/tgRqPwmk2n93RJEXTV6GBbcwqGAzMzk98doeDBZTVlfH6GJUZFkaUYBE3v sB4ckyFo1/j92YU+bu6ajVTrl5oe/41Huv0kv8jOsj5n9x7y7x7UsqIJ+7tN5Mek0TvV UPRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=LvaDR7H2gtE9foQcxzDPZkYWcoBud/gED61kzm9fbgs=; b=JlH8BsA+Re8nmi45r45Net+6uGDN59qysWyqHmckW67xwGnc2NqZCJYT3CPt8IEtcz pX/WmXnB7UOJgSaj7yt4D7Rv762idcYImPWrasMKmmD3Bz6uDA1kft9c7GSgc3/R/0We xFWeXRhavwvANDKuARWmmzTwbKGNYimVdJEmzj+zJPLfprjPg9X4oqRUGkLxCNSOjRPF SeYD1Sp6f2Ud8hmyp/BBHwV0iQUa5M8dJ/yRZx+P912P0vf3cqoahAfs2FzhoLc2zG/3 QcYoCct4rAVj02kzirIE2LhvzLCcP610IhbSXmz+OdYifA+NDy9DJ1PIW3xhCBUzW3kW YjaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Fj9eCSsv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si1713182plj.311.2017.06.28.11.48.39; Wed, 28 Jun 2017 11:48:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Fj9eCSsv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbdF1Ss1 (ORCPT + 25 others); Wed, 28 Jun 2017 14:48:27 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33924 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbdF1SsV (ORCPT ); Wed, 28 Jun 2017 14:48:21 -0400 Received: by mail-pf0-f176.google.com with SMTP id s66so37716851pfs.1 for ; Wed, 28 Jun 2017 11:48:21 -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; bh=LvaDR7H2gtE9foQcxzDPZkYWcoBud/gED61kzm9fbgs=; b=Fj9eCSsvhXXRzEGqndV8i9Tw/nxmpGWIJ8W+cuYhhQHd+j74ErWYcfNwatv2gG5IPy pWPUfOuTPtGNiv6WhyAM0TdNLymT5w5nV3h+CqCJLGtUlEfhV8ZhwZw/Y7FWA7mRq35L wVVM+QeO/zlXBP0xx0CPf0Dqtt/szC+iKAbqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LvaDR7H2gtE9foQcxzDPZkYWcoBud/gED61kzm9fbgs=; b=dx73nRFHHhTLBJGbCE5xMNaPVO8ss0JBUw+FPto6AtPLjBLzswnPjkTgrv1iFR+wOP Qpj4RhgE4fb8gUGGaywQegf0nIPo6NceXJ+dfUYtJ5fI9O3G6G9bHBNNY+Jq0BPMNWbP UEaHAdkscKS9uWjKfk7V+rbXf4h3jNintRqCEhbHAXkIHfK4Iar+VgKCXMWx3krH3N40 M1RThRCnGNdaSyek67RdKqwSYSA5WTx9b6Qa2oOPC4OmvIzFKOvK7dcvt+/lPwmYsBJC QlkDm9AWhNLxI//YKa3dr1EC87lMXXmex3q9bueBfoyCc5rOVOS6zB72vTITla0ecG6O S/5g== X-Gm-Message-State: AKS2vOw/ufslPAyN/5VdSZcRd59wY7nzwE4oreEWj/JhGdBLyGlqWoTP VxDPlBubEkZAL628 X-Received: by 10.84.137.1 with SMTP id 1mr13809155plm.128.1498675700899; Wed, 28 Jun 2017 11:48:20 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id r83sm6614525pfk.57.2017.06.28.11.48.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 11:48:20 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson , Rob Clark Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rpmsg: Make modalias work for DeviceTree based devices Date: Wed, 28 Jun 2017 11:48:16 -0700 Message-Id: <20170628184816.28300-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When rpmsg devices are expected to be matched based on their compatible the modalias should reflect this, so that module autoloading has a chance to match and load the appropriate module. Reported-by: Rob Clark Signed-off-by: Bjorn Andersson --- drivers/rpmsg/rpmsg_core.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.12.0 diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index ad3d2a9df287..b7e16fc3a6c7 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -343,6 +343,11 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { struct rpmsg_device *rpdev = to_rpmsg_device(dev); + ssize_t len; + + len = of_device_modalias(dev, buf, PAGE_SIZE); + if (len != -ENODEV) + return len; return sprintf(buf, RPMSG_DEVICE_MODALIAS_FMT "\n", rpdev->id.name); }