From patchwork Tue Jun 15 13:32:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12321647 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D481EC48BE8 for ; Tue, 15 Jun 2021 13:34:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8C4E6146D for ; Tue, 15 Jun 2021 13:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231245AbhFONgr (ORCPT ); Tue, 15 Jun 2021 09:36:47 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:18826 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbhFONgT (ORCPT ); Tue, 15 Jun 2021 09:36:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623764033; cv=none; d=strato.com; s=strato-dkim-0002; b=bIqp0AJnjs3EN1lBoq0EnBfT5OYxVkJiYgGjYhQo4uRow1+nDjiXjjUFKxs1bTikB2 UN1nk/Cmv63z+ywiXyRApZRPZvt04nWauxHjk5XVIdlsdw89tdBWlYR4zaoaMQ7sDOcP uLi4uCSaMB7Jo2+EwDZ9fztUpX3WgEVFb2TNfjg8EzOzgSX7/uVSPZqh3a6UUcEIPPsw gpjUbGNpJOaORxDIFHoonAK1y69ijcnZvuulfm5atimH2w/OlkyWgsk1BbOmxSYewKIb US2zv4PvbQTwp79G8Gm/ujANTJ7tTEzgcHMe/iOFx2XxyEvksSdjGxV1Ke1vmNfT/OD9 sKsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623764033; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=3TdVNRSVdWVw+TLJWZU/FaKUgvTAWh+NLNbOyH7Egqo=; b=NkJvkf2r6HRpRVFDtP5GrqbunOrmKKcbWqE+h2jGGuEY0OXDgd8AN7rc/uR8ZXXN6y o6PBYLMPrqqUgk51zFRN17bpluRKilY1lkJhpb9Rrfgb9LKri3OcZm89vRwRWAzm7Gq8 ZI4OrNJATonX+th/t9kKy3MUfiCDsrMMBCGMEyOligRNXc8RyoLvN5qwGzWYXtaUpoqt sRCOhuy4Yt0ntZjlTWJnytw4gBXh7IY19Km+/tjaSSn+Dd18rprQrzIsg0XzL26K98D5 uOT27avskD+mnfG/47bLscMp+LnyK+W/ppyl186e/8SPkNJhy8rKLEenxUplFAu9jpQ5 xCQg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623764033; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=3TdVNRSVdWVw+TLJWZU/FaKUgvTAWh+NLNbOyH7Egqo=; b=rU/M87SIQ2fP0OgGR1bWk2BKe8E4Bwg9oPzVfiiP5LseRl+PsC5NpJr2s5mqxG+/3c hXhZpL+R+ULkNTgKpVJlN/r9XqlE9YqFRW37CCPr0nauCN2lliPYY54ORlTl/GOpmEVj LdLwPaQC78uRkejcPF4Ekq/xhMH0VbvuyLCE/EaVt3vjk7HKDZgIiZ89N1PVK0FjXw80 NW7ChYouJjFH+J/2lXRZ0p12DaNedBmYGECCP7Y2Xf43xKOdtEQYHyU1AiMYuTQtpuBw xK6WVFfuJIgfwOowbYTV07mk3FetgS33A75OKMW5tWzuw39HcejBFLKLWvCxi6fThQtA JwJg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6NutzT" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5FDXqOsm (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 15 Jun 2021 15:33:52 +0200 (CEST) From: Stephan Gerhold To: "David S. Miller" , Jakub Kicinski Cc: Loic Poulain , Bjorn Andersson , Aleksander Morgado , Sergey Ryazanov , Johannes Berg , M Chetan Kumar , Ohad Ben-Cohen , Mathieu Poirier , netdev@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH net-next 1/3] rpmsg: core: Add driver_data for rpmsg_device_id Date: Tue, 15 Jun 2021 15:32:27 +0200 Message-Id: <20210615133229.213064-2-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210615133229.213064-1-stephan@gerhold.net> References: <20210615133229.213064-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Most device_id structs provide a driver_data field that can be used by drivers to associate data more easily for a particular device ID. Add the same for the rpmsg_device_id. Signed-off-by: Stephan Gerhold --- drivers/rpmsg/rpmsg_core.c | 4 +++- include/linux/mod_devicetable.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index e5daee4f9373..c1404d3dae2c 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -459,8 +459,10 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv) if (ids) for (i = 0; ids[i].name[0]; i++) - if (rpmsg_id_match(rpdev, &ids[i])) + if (rpmsg_id_match(rpdev, &ids[i])) { + rpdev->id.driver_data = ids[i].driver_data; return 1; + } return of_driver_match_device(dev, drv); } diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 7d45b5f989b0..8e291cfdaf06 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -447,6 +447,7 @@ struct hv_vmbus_device_id { struct rpmsg_device_id { char name[RPMSG_NAME_SIZE]; + kernel_ulong_t driver_data; }; /* i2c */