Lines Matching refs:dev
82 static int adc_joystick_open(struct input_dev *dev)
84 struct adc_joystick *joy = input_get_drvdata(dev);
85 struct device *devp = &dev->dev;
95 static void adc_joystick_close(struct input_dev *dev)
97 struct adc_joystick *joy = input_get_drvdata(dev);
107 static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy)
113 num_axes = device_get_child_node_count(dev);
115 dev_err(dev, "Unable to find child nodes\n");
120 dev_err(dev, "Got %d child nodes for %d channels\n",
125 axes = devm_kmalloc_array(dev, num_axes, sizeof(*axes), GFP_KERNEL);
129 device_for_each_child_node(dev, child) {
132 dev_err(dev, "reg invalid or missing\n");
138 dev_err(dev, "No matching axis for reg %d\n", i);
145 dev_err(dev, "linux,code invalid or missing\n");
152 dev_err(dev, "abs-range invalid or missing\n");
176 struct device *dev = &pdev->dev;
183 joy = devm_kzalloc(dev, sizeof(*joy), GFP_KERNEL);
187 joy->chans = devm_iio_channel_get_all(dev);
191 dev_err(dev, "Unable to get IIO channels");
199 dev_err(dev, "Unsupported channel storage size\n");
203 dev_err(dev, "Channels must have equal storage size\n");
209 input = devm_input_allocate_device(dev);
211 dev_err(dev, "Unable to allocate input device\n");
221 error = adc_joystick_set_axes(dev, joy);
228 dev_err(dev, "Unable to register input device\n");
232 joy->buffer = iio_channel_get_all_cb(dev, adc_joystick_handle, joy);
234 dev_err(dev, "Unable to allocate callback buffer\n");
238 error = devm_add_action_or_reset(dev, adc_joystick_cleanup, joy->buffer);
240 dev_err(dev, "Unable to add action\n");