diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-09-15 12:50:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-15 14:05:07 -0400 |
commit | 8c60c7e75de79fe429afea3c7300d010c091bc4e (patch) | |
tree | 81aa0ec318da5d305f06f7944017732a7f63dd5b /drivers/iio | |
parent | 5d65d92045cb7d3b2c45020c0e62d6d1c1d34f37 (diff) |
iio: Remove unnecessary casts for iio_push_to_buffers()
Now that iio_push_to_buffers() takes a void pointer for the data parameter we
can remove those casts to u8*.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/bma180.c | 2 | ||||
-rw-r--r-- | drivers/iio/accel/hid-sensor-accel-3d.c | 7 | ||||
-rw-r--r-- | drivers/iio/adc/ad7266.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/ad7298.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/ad7923.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/ad_sigma_delta.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/at91_adc.c | 2 | ||||
-rw-r--r-- | drivers/iio/gyro/hid-sensor-gyro-3d.c | 7 | ||||
-rw-r--r-- | drivers/iio/gyro/itg3200_buffer.c | 2 | ||||
-rw-r--r-- | drivers/iio/light/adjd_s311.c | 2 | ||||
-rw-r--r-- | drivers/iio/light/hid-sensor-als.c | 7 | ||||
-rw-r--r-- | drivers/iio/light/tcs3472.c | 2 | ||||
-rw-r--r-- | drivers/iio/magnetometer/hid-sensor-magn-3d.c | 7 |
13 files changed, 25 insertions, 21 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 12e32e6b4103..3eff2469dba9 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
@@ -490,7 +490,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p) | |||
490 | } | 490 | } |
491 | mutex_unlock(&data->mutex); | 491 | mutex_unlock(&data->mutex); |
492 | 492 | ||
493 | iio_push_to_buffers(indio_dev, (u8 *)data->buff); | 493 | iio_push_to_buffers(indio_dev, data->buff); |
494 | err: | 494 | err: |
495 | iio_trigger_notify_done(indio_dev->trig); | 495 | iio_trigger_notify_done(indio_dev->trig); |
496 | 496 | ||
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index 46d22f3fb1a9..dcda17395c4e 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c | |||
@@ -182,10 +182,11 @@ static const struct iio_info accel_3d_info = { | |||
182 | }; | 182 | }; |
183 | 183 | ||
184 | /* Function to push data to buffer */ | 184 | /* Function to push data to buffer */ |
185 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) | 185 | static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data, |
186 | int len) | ||
186 | { | 187 | { |
187 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); | 188 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); |
188 | iio_push_to_buffers(indio_dev, (u8 *)data); | 189 | iio_push_to_buffers(indio_dev, data); |
189 | } | 190 | } |
190 | 191 | ||
191 | /* Callback handler to send event after all samples are received and captured */ | 192 | /* Callback handler to send event after all samples are received and captured */ |
@@ -200,7 +201,7 @@ static int accel_3d_proc_event(struct hid_sensor_hub_device *hsdev, | |||
200 | accel_state->common_attributes.data_ready); | 201 | accel_state->common_attributes.data_ready); |
201 | if (accel_state->common_attributes.data_ready) | 202 | if (accel_state->common_attributes.data_ready) |
202 | hid_sensor_push_data(indio_dev, | 203 | hid_sensor_push_data(indio_dev, |
203 | (u8 *)accel_state->accel_val, | 204 | accel_state->accel_val, |
204 | sizeof(accel_state->accel_val)); | 205 | sizeof(accel_state->accel_val)); |
205 | 206 | ||
206 | return 0; | 207 | return 0; |
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 371731df1634..5bfed2398b70 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c | |||
@@ -98,7 +98,7 @@ static irqreturn_t ad7266_trigger_handler(int irq, void *p) | |||
98 | if (ret == 0) { | 98 | if (ret == 0) { |
99 | if (indio_dev->scan_timestamp) | 99 | if (indio_dev->scan_timestamp) |
100 | ((s64 *)st->data)[1] = pf->timestamp; | 100 | ((s64 *)st->data)[1] = pf->timestamp; |
101 | iio_push_to_buffers(indio_dev, (u8 *)st->data); | 101 | iio_push_to_buffers(indio_dev, st->data); |
102 | } | 102 | } |
103 | 103 | ||
104 | iio_trigger_notify_done(indio_dev->trig); | 104 | iio_trigger_notify_done(indio_dev->trig); |
diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index 85d1481c312f..0812556c11ff 100644 --- a/drivers/iio/adc/ad7298.c +++ b/drivers/iio/adc/ad7298.c | |||
@@ -172,7 +172,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p) | |||
172 | &time_ns, sizeof(time_ns)); | 172 | &time_ns, sizeof(time_ns)); |
173 | } | 173 | } |
174 | 174 | ||
175 | iio_push_to_buffers(indio_dev, (u8 *)st->rx_buf); | 175 | iio_push_to_buffers(indio_dev, st->rx_buf); |
176 | 176 | ||
177 | done: | 177 | done: |
178 | iio_trigger_notify_done(indio_dev->trig); | 178 | iio_trigger_notify_done(indio_dev->trig); |
diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c index 4108dbb28c3d..7eb4cb5a7f0d 100644 --- a/drivers/iio/adc/ad7923.c +++ b/drivers/iio/adc/ad7923.c | |||
@@ -187,7 +187,7 @@ static irqreturn_t ad7923_trigger_handler(int irq, void *p) | |||
187 | &time_ns, sizeof(time_ns)); | 187 | &time_ns, sizeof(time_ns)); |
188 | } | 188 | } |
189 | 189 | ||
190 | iio_push_to_buffers(indio_dev, (u8 *)st->rx_buf); | 190 | iio_push_to_buffers(indio_dev, st->rx_buf); |
191 | 191 | ||
192 | done: | 192 | done: |
193 | iio_trigger_notify_done(indio_dev->trig); | 193 | iio_trigger_notify_done(indio_dev->trig); |
diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index f0d6335ae087..78d276f40c8e 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c | |||
@@ -391,7 +391,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p) | |||
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | 393 | ||
394 | iio_push_to_buffers(indio_dev, (uint8_t *)data); | 394 | iio_push_to_buffers(indio_dev, data); |
395 | 395 | ||
396 | iio_trigger_notify_done(indio_dev->trig); | 396 | iio_trigger_notify_done(indio_dev->trig); |
397 | sigma_delta->irq_dis = false; | 397 | sigma_delta->irq_dis = false; |
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 84be63bdf038..6da5ebb25502 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -89,7 +89,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p) | |||
89 | *timestamp = pf->timestamp; | 89 | *timestamp = pf->timestamp; |
90 | } | 90 | } |
91 | 91 | ||
92 | iio_push_to_buffers(idev, (u8 *)st->buffer); | 92 | iio_push_to_buffers(idev, st->buffer); |
93 | 93 | ||
94 | iio_trigger_notify_done(idev->trig); | 94 | iio_trigger_notify_done(idev->trig); |
95 | 95 | ||
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index c688d974d3e3..ea01c6bcfb56 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c | |||
@@ -182,10 +182,11 @@ static const struct iio_info gyro_3d_info = { | |||
182 | }; | 182 | }; |
183 | 183 | ||
184 | /* Function to push data to buffer */ | 184 | /* Function to push data to buffer */ |
185 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) | 185 | static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data, |
186 | int len) | ||
186 | { | 187 | { |
187 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); | 188 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); |
188 | iio_push_to_buffers(indio_dev, (u8 *)data); | 189 | iio_push_to_buffers(indio_dev, data); |
189 | } | 190 | } |
190 | 191 | ||
191 | /* Callback handler to send event after all samples are received and captured */ | 192 | /* Callback handler to send event after all samples are received and captured */ |
@@ -200,7 +201,7 @@ static int gyro_3d_proc_event(struct hid_sensor_hub_device *hsdev, | |||
200 | gyro_state->common_attributes.data_ready); | 201 | gyro_state->common_attributes.data_ready); |
201 | if (gyro_state->common_attributes.data_ready) | 202 | if (gyro_state->common_attributes.data_ready) |
202 | hid_sensor_push_data(indio_dev, | 203 | hid_sensor_push_data(indio_dev, |
203 | (u8 *)gyro_state->gyro_val, | 204 | gyro_state->gyro_val, |
204 | sizeof(gyro_state->gyro_val)); | 205 | sizeof(gyro_state->gyro_val)); |
205 | 206 | ||
206 | return 0; | 207 | return 0; |
diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index 6c43af9bb0a4..6b3c30118c48 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c | |||
@@ -59,7 +59,7 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p) | |||
59 | memcpy(buf + indio_dev->scan_bytes - sizeof(s64), | 59 | memcpy(buf + indio_dev->scan_bytes - sizeof(s64), |
60 | &pf->timestamp, sizeof(pf->timestamp)); | 60 | &pf->timestamp, sizeof(pf->timestamp)); |
61 | 61 | ||
62 | iio_push_to_buffers(indio_dev, (u8 *)buf); | 62 | iio_push_to_buffers(indio_dev, buf); |
63 | iio_trigger_notify_done(indio_dev->trig); | 63 | iio_trigger_notify_done(indio_dev->trig); |
64 | 64 | ||
65 | error_ret: | 65 | error_ret: |
diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c index c0da351b1c2e..c9c8b002b27d 100644 --- a/drivers/iio/light/adjd_s311.c +++ b/drivers/iio/light/adjd_s311.c | |||
@@ -141,7 +141,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p) | |||
141 | if (indio_dev->scan_timestamp) | 141 | if (indio_dev->scan_timestamp) |
142 | *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64))) | 142 | *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64))) |
143 | = time_ns; | 143 | = time_ns; |
144 | iio_push_to_buffers(indio_dev, (u8 *)data->buffer); | 144 | iio_push_to_buffers(indio_dev, data->buffer); |
145 | 145 | ||
146 | done: | 146 | done: |
147 | iio_trigger_notify_done(indio_dev->trig); | 147 | iio_trigger_notify_done(indio_dev->trig); |
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index e59d00c3139c..fa6ae8cf89ea 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c | |||
@@ -161,10 +161,11 @@ static const struct iio_info als_info = { | |||
161 | }; | 161 | }; |
162 | 162 | ||
163 | /* Function to push data to buffer */ | 163 | /* Function to push data to buffer */ |
164 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) | 164 | static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data, |
165 | int len) | ||
165 | { | 166 | { |
166 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); | 167 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); |
167 | iio_push_to_buffers(indio_dev, (u8 *)data); | 168 | iio_push_to_buffers(indio_dev, data); |
168 | } | 169 | } |
169 | 170 | ||
170 | /* Callback handler to send event after all samples are received and captured */ | 171 | /* Callback handler to send event after all samples are received and captured */ |
@@ -179,7 +180,7 @@ static int als_proc_event(struct hid_sensor_hub_device *hsdev, | |||
179 | als_state->common_attributes.data_ready); | 180 | als_state->common_attributes.data_ready); |
180 | if (als_state->common_attributes.data_ready) | 181 | if (als_state->common_attributes.data_ready) |
181 | hid_sensor_push_data(indio_dev, | 182 | hid_sensor_push_data(indio_dev, |
182 | (u8 *)&als_state->illum, | 183 | &als_state->illum, |
183 | sizeof(als_state->illum)); | 184 | sizeof(als_state->illum)); |
184 | 185 | ||
185 | return 0; | 186 | return 0; |
diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index dc7d8234134f..7bf296943745 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c | |||
@@ -195,7 +195,7 @@ static irqreturn_t tcs3472_trigger_handler(int irq, void *p) | |||
195 | if (indio_dev->scan_timestamp) | 195 | if (indio_dev->scan_timestamp) |
196 | *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64))) | 196 | *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64))) |
197 | = iio_get_time_ns(); | 197 | = iio_get_time_ns(); |
198 | iio_push_to_buffers(indio_dev, (u8 *)data->buffer); | 198 | iio_push_to_buffers(indio_dev, data->buffer); |
199 | 199 | ||
200 | done: | 200 | done: |
201 | iio_trigger_notify_done(indio_dev->trig); | 201 | iio_trigger_notify_done(indio_dev->trig); |
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c index a98460b15e4b..2634920562fb 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c | |||
@@ -183,10 +183,11 @@ static const struct iio_info magn_3d_info = { | |||
183 | }; | 183 | }; |
184 | 184 | ||
185 | /* Function to push data to buffer */ | 185 | /* Function to push data to buffer */ |
186 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) | 186 | static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data, |
187 | int len) | ||
187 | { | 188 | { |
188 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); | 189 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); |
189 | iio_push_to_buffers(indio_dev, (u8 *)data); | 190 | iio_push_to_buffers(indio_dev, data); |
190 | } | 191 | } |
191 | 192 | ||
192 | /* Callback handler to send event after all samples are received and captured */ | 193 | /* Callback handler to send event after all samples are received and captured */ |
@@ -201,7 +202,7 @@ static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev, | |||
201 | magn_state->common_attributes.data_ready); | 202 | magn_state->common_attributes.data_ready); |
202 | if (magn_state->common_attributes.data_ready) | 203 | if (magn_state->common_attributes.data_ready) |
203 | hid_sensor_push_data(indio_dev, | 204 | hid_sensor_push_data(indio_dev, |
204 | (u8 *)magn_state->magn_val, | 205 | magn_state->magn_val, |
205 | sizeof(magn_state->magn_val)); | 206 | sizeof(magn_state->magn_val)); |
206 | 207 | ||
207 | return 0; | 208 | return 0; |