Permalink
Browse files

linkdev: Allow platform data to override device name

  • Loading branch information...
1 parent ace6298 commit 2dea8ec91295e69606fe364b26cb63f6217f3bc1 @pcercuei pcercuei committed Feb 4, 2014
Showing with 8 additions and 1 deletion.
  1. +5 −1 drivers/input/linkdev.c
  2. +3 −0 include/linux/platform_data/linkdev.h
View
@@ -284,6 +284,7 @@ static int linkdev_create_device(struct linkdev *linkdev)
int ret;
struct input_dev *idev;
struct platform_device *pdev = linkdev->pdev;
+ struct linkdev_platform_data *pdata = linkdev->pdata;
idev = input_allocate_device();
if (!idev) {
@@ -292,9 +293,12 @@ static int linkdev_create_device(struct linkdev *linkdev)
}
linkdev->idev = idev;
- idev->name = "linkdev-device";
idev->id.bustype = BUS_HOST;
idev->dev.parent = &pdev->dev;
+ if (pdata->name)
+ idev->name = pdata->name;
+ else
+ idev->name = "linkdev-device";
linkdev_set_bits(linkdev);
@@ -42,6 +42,9 @@ struct linkdev_platform_data {
const struct linkdev_pdata_abs_map *abs_map;
unsigned int abs_map_size;
+ /* Name of the linkdev device (defaults to "linkdev-device" if NULL) */
+ const char *name;
+
/* Reserved for internal use */
void *__private;
};

0 comments on commit 2dea8ec

Please sign in to comment.