[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210615133229.213064-2-stephan@gerhold.net>
Date: Tue, 15 Jun 2021 15:32:27 +0200
From: Stephan Gerhold <stephan@...hold.net>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Loic Poulain <loic.poulain@...aro.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Aleksander Morgado <aleksander@...ksander.es>,
Sergey Ryazanov <ryazanov.s.a@...il.com>,
Johannes Berg <johannes.berg@...el.com>,
M Chetan Kumar <m.chetan.kumar@...el.com>,
Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
netdev@...r.kernel.org, linux-remoteproc@...r.kernel.org,
linux-arm-msm@...r.kernel.org, phone-devel@...r.kernel.org,
linux-kernel@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht,
Stephan Gerhold <stephan@...hold.net>
Subject: [PATCH net-next 1/3] rpmsg: core: Add driver_data for rpmsg_device_id
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 <stephan@...hold.net>
---
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 */
--
2.32.0
Powered by blists - more mailing lists