diff options
Diffstat (limited to 'drivers/fpga/dfl.h')
-rw-r--r-- | drivers/fpga/dfl.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h index 66c2ade5a06b..b4f65250a29c 100644 --- a/drivers/fpga/dfl.h +++ b/drivers/fpga/dfl.h | |||
@@ -284,4 +284,25 @@ struct dfl_fpga_cdev * | |||
284 | dfl_fpga_feature_devs_enumerate(struct dfl_fpga_enum_info *info); | 284 | dfl_fpga_feature_devs_enumerate(struct dfl_fpga_enum_info *info); |
285 | void dfl_fpga_feature_devs_remove(struct dfl_fpga_cdev *cdev); | 285 | void dfl_fpga_feature_devs_remove(struct dfl_fpga_cdev *cdev); |
286 | 286 | ||
287 | /* | ||
288 | * need to drop the device reference with put_device() after use port platform | ||
289 | * device returned by __dfl_fpga_cdev_find_port and dfl_fpga_cdev_find_port | ||
290 | * functions. | ||
291 | */ | ||
292 | struct platform_device * | ||
293 | __dfl_fpga_cdev_find_port(struct dfl_fpga_cdev *cdev, void *data, | ||
294 | int (*match)(struct platform_device *, void *)); | ||
295 | |||
296 | static inline struct platform_device * | ||
297 | dfl_fpga_cdev_find_port(struct dfl_fpga_cdev *cdev, void *data, | ||
298 | int (*match)(struct platform_device *, void *)) | ||
299 | { | ||
300 | struct platform_device *pdev; | ||
301 | |||
302 | mutex_lock(&cdev->lock); | ||
303 | pdev = __dfl_fpga_cdev_find_port(cdev, data, match); | ||
304 | mutex_unlock(&cdev->lock); | ||
305 | |||
306 | return pdev; | ||
307 | } | ||
287 | #endif /* __FPGA_DFL_H */ | 308 | #endif /* __FPGA_DFL_H */ |