summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-14 12:46:27 +0200
commitb7d1cc08cc3842697b5148d1a9d244c2c19dc834 (patch)
treecb4a97568ec7ae173929d9522ba9c9ae7ae30a01 /include
parentd5a40ed62b34ec05ca6e496748ac551560e0846f (diff)
parent8e3d1f21d83eb5abb1478dae3b7c263da47cb797 (diff)
downloadbarebox-b7d1cc08cc3842697b5148d1a9d244c2c19dc834.tar.gz
barebox-b7d1cc08cc3842697b5148d1a9d244c2c19dc834.tar.xz
Merge branch 'for-next/dev-drvdata' into master
Diffstat (limited to 'include')
-rw-r--r--include/driver.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 154525e0fd..14220431f2 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -534,8 +534,26 @@ int devfs_create_partitions(const char *devname,
#define DRV_OF_COMPAT(compat) \
IS_ENABLED(CONFIG_OFDEVICE) ? (compat) : NULL
+/**
+ * dev_get_drvdata - get driver match data associated with device
+ * @dev: device instance
+ * @data: pointer to void *, where match data is stored
+ *
+ * Returns 0 on success and error code otherwise.
+ *
+ * DEPRECATED: use device_get_match_data instead, which avoids
+ * common pitfalls due to explicit pointer casts
+ */
int dev_get_drvdata(struct device_d *dev, const void **data);
+/**
+ * device_get_match_data - get driver match data associated with device
+ * @dev: device instance
+ *
+ * Returns match data on success and NULL otherwise
+ */
+const void *device_get_match_data(struct device_d *dev);
+
int device_match_of_modalias(struct device_d *dev, struct driver_d *drv);
#endif /* DRIVER_H */