Skip to content

Commit

Permalink
Input: remove private member from input_dev structure
Browse files Browse the repository at this point in the history
Everyone should be using input_{get|set}_drvdata() by now.
Alias them to dev_{get|set}_drvdata() and remove ->private.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Apr 2, 2008
1 parent a7097ff commit 3797fec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions drivers/input/input-polldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void input_polled_device_work(struct work_struct *work)

static int input_open_polled_device(struct input_dev *input)
{
struct input_polled_dev *dev = input->private;
struct input_polled_dev *dev = input_get_drvdata(input);
int error;

error = input_polldev_start_workqueue();
Expand All @@ -91,7 +91,7 @@ static int input_open_polled_device(struct input_dev *input)

static void input_close_polled_device(struct input_dev *input)
{
struct input_polled_dev *dev = input->private;
struct input_polled_dev *dev = input_get_drvdata(input);

cancel_delayed_work_sync(&dev->work);
input_polldev_stop_workqueue();
Expand Down Expand Up @@ -151,10 +151,10 @@ int input_register_polled_device(struct input_polled_dev *dev)
{
struct input_dev *input = dev->input;

input_set_drvdata(input, dev);
INIT_DELAYED_WORK(&dev->work, input_polled_device_work);
if (!dev->poll_interval)
dev->poll_interval = 500;
input->private = dev;
input->open = input_open_polled_device;
input->close = input_close_polled_device;

Expand Down
8 changes: 2 additions & 6 deletions include/linux/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,6 @@ struct ff_effect {
* @node: used to place the device onto input_dev_list
*/
struct input_dev {
/* private: */
void *private; /* do not use */
/* public: */

const char *name;
const char *phys;
const char *uniq;
Expand Down Expand Up @@ -1238,12 +1234,12 @@ static inline void input_put_device(struct input_dev *dev)

static inline void *input_get_drvdata(struct input_dev *dev)
{
return dev->private;
return dev_get_drvdata(&dev->dev);
}

static inline void input_set_drvdata(struct input_dev *dev, void *data)
{
dev->private = data;
dev_set_drvdata(&dev->dev, data);
}

int __must_check input_register_device(struct input_dev *);
Expand Down

0 comments on commit 3797fec

Please sign in to comment.