From patchwork Fri Jun 18 07:52:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 463752 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, URIBL_BLOCKED, 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 D677DC49EA3 for ; Fri, 18 Jun 2021 07:54:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C21B96109E for ; Fri, 18 Jun 2021 07:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233639AbhFRH4f (ORCPT ); Fri, 18 Jun 2021 03:56:35 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.168]:20285 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232149AbhFRH4Y (ORCPT ); Fri, 18 Jun 2021 03:56:24 -0400 X-Greylist: delayed 139224 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Jun 2021 03:56:23 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1624002848; 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=pV6Ft6oOUmVeMb8nCyE2JYFkklCXcfcgJq0yra9LYEY=; b=DxfQpkjdcTIzj87SuWLOgl5gGJmfxZyANWKOGGw0b+MqcLrduwzz/B8d2GPLqBLAMm MHhnbg/i+BdzAgR+UlXFT/mh5m69xjX7jOBobF3UJqFw8DtDX1n54ua6bS7pc/1XgcUr dykazttpxmILq1fsZgBzttTdXbP/tv41sK5w+dznt2TmGwMneISTltH4Yo79ecEg5hbt pKJW3nNUXwM9yAiBSnJLk1iu2lckjMl3uGGiN+TjbdOAH3iT7k8P3PCn2LuKQZaJi1fL GxcNUf5r7z2+JDcGvHVroKP7YYXTpo42/ISmT/nQERqlTZ79hSqTAnA+MvkoDd806PEF +97Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626EOg==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.3 DYNA|AUTH) with ESMTPSA id 000885x5I7s84DC (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 18 Jun 2021 09:54:08 +0200 (CEST) From: Stephan Gerhold To: "David S. Miller" , Jakub Kicinski Cc: Loic Poulain , Bjorn Andersson , Aleksander Morgado , Sergey Ryazanov , Johannes Berg , Leon Romanovsky , M Chetan Kumar , linuxwwan@intel.com, 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 v2 1/3] rpmsg: core: Add driver_data for rpmsg_device_id Date: Fri, 18 Jun 2021 09:52:41 +0200 Message-Id: <20210618075243.42046-2-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210618075243.42046-1-stephan@gerhold.net> References: <20210618075243.42046-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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. Cc: Bjorn Andersson Signed-off-by: Stephan Gerhold --- Changes in v2: None --- 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 */