Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:pressure: Changed pressure data variable name to press_data

This patch fix pressure data variable name. Usually pdata name
it is used for platform data.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Denis CIOCCA and committed by
Jonathan Cameron
a1dcf429 0baa3fc1

+37 -35
+6 -6
drivers/iio/pressure/st_pressure_buffer.c
··· 38 38 static int st_press_buffer_postenable(struct iio_dev *indio_dev) 39 39 { 40 40 int err; 41 - struct st_sensor_data *pdata = iio_priv(indio_dev); 41 + struct st_sensor_data *press_data = iio_priv(indio_dev); 42 42 43 - pdata->buffer_data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); 44 - if (pdata->buffer_data == NULL) { 43 + press_data->buffer_data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); 44 + if (press_data->buffer_data == NULL) { 45 45 err = -ENOMEM; 46 46 goto allocate_memory_error; 47 47 } ··· 53 53 return err; 54 54 55 55 st_press_buffer_postenable_error: 56 - kfree(pdata->buffer_data); 56 + kfree(press_data->buffer_data); 57 57 allocate_memory_error: 58 58 return err; 59 59 } ··· 61 61 static int st_press_buffer_predisable(struct iio_dev *indio_dev) 62 62 { 63 63 int err; 64 - struct st_sensor_data *pdata = iio_priv(indio_dev); 64 + struct st_sensor_data *press_data = iio_priv(indio_dev); 65 65 66 66 err = iio_triggered_buffer_predisable(indio_dev); 67 67 if (err < 0) ··· 70 70 err = st_sensors_set_enable(indio_dev, false); 71 71 72 72 st_press_buffer_predisable_error: 73 - kfree(pdata->buffer_data); 73 + kfree(press_data->buffer_data); 74 74 return err; 75 75 } 76 76
+21 -19
drivers/iio/pressure/st_pressure_core.c
··· 333 333 int *val2, long mask) 334 334 { 335 335 int err; 336 - struct st_sensor_data *pdata = iio_priv(indio_dev); 336 + struct st_sensor_data *press_data = iio_priv(indio_dev); 337 337 338 338 switch (mask) { 339 339 case IIO_CHAN_INFO_RAW: ··· 347 347 348 348 switch (ch->type) { 349 349 case IIO_PRESSURE: 350 - *val2 = pdata->current_fullscale->gain; 350 + *val2 = press_data->current_fullscale->gain; 351 351 break; 352 352 case IIO_TEMP: 353 - *val2 = pdata->current_fullscale->gain2; 353 + *val2 = press_data->current_fullscale->gain2; 354 354 break; 355 355 default: 356 356 err = -EINVAL; ··· 371 371 372 372 return IIO_VAL_FRACTIONAL; 373 373 case IIO_CHAN_INFO_SAMP_FREQ: 374 - *val = pdata->odr; 374 + *val = press_data->odr; 375 375 return IIO_VAL_INT; 376 376 default: 377 377 return -EINVAL; ··· 411 411 412 412 int st_press_common_probe(struct iio_dev *indio_dev) 413 413 { 414 - struct st_sensor_data *pdata = iio_priv(indio_dev); 415 - int irq = pdata->get_irq_data_ready(indio_dev); 414 + struct st_sensor_data *press_data = iio_priv(indio_dev); 415 + int irq = press_data->get_irq_data_ready(indio_dev); 416 416 int err; 417 417 418 418 indio_dev->modes = INDIO_DIRECT_MODE; ··· 426 426 if (err < 0) 427 427 return err; 428 428 429 - pdata->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS; 430 - pdata->multiread_bit = pdata->sensor_settings->multi_read_bit; 431 - indio_dev->channels = pdata->sensor_settings->ch; 432 - indio_dev->num_channels = pdata->sensor_settings->num_ch; 429 + press_data->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS; 430 + press_data->multiread_bit = press_data->sensor_settings->multi_read_bit; 431 + indio_dev->channels = press_data->sensor_settings->ch; 432 + indio_dev->num_channels = press_data->sensor_settings->num_ch; 433 433 434 - if (pdata->sensor_settings->fs.addr != 0) 435 - pdata->current_fullscale = (struct st_sensor_fullscale_avl *) 436 - &pdata->sensor_settings->fs.fs_avl[0]; 434 + if (press_data->sensor_settings->fs.addr != 0) 435 + press_data->current_fullscale = 436 + (struct st_sensor_fullscale_avl *) 437 + &press_data->sensor_settings->fs.fs_avl[0]; 437 438 438 - pdata->odr = pdata->sensor_settings->odr.odr_avl[0].hz; 439 + press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz; 439 440 440 441 /* Some devices don't support a data ready pin. */ 441 - if (!pdata->dev->platform_data && pdata->sensor_settings->drdy_irq.addr) 442 - pdata->dev->platform_data = 442 + if (!press_data->dev->platform_data && 443 + press_data->sensor_settings->drdy_irq.addr) 444 + press_data->dev->platform_data = 443 445 (struct st_sensors_platform_data *)&default_press_pdata; 444 446 445 - err = st_sensors_init_sensor(indio_dev, pdata->dev->platform_data); 447 + err = st_sensors_init_sensor(indio_dev, press_data->dev->platform_data); 446 448 if (err < 0) 447 449 return err; 448 450 ··· 480 478 481 479 void st_press_common_remove(struct iio_dev *indio_dev) 482 480 { 483 - struct st_sensor_data *pdata = iio_priv(indio_dev); 481 + struct st_sensor_data *press_data = iio_priv(indio_dev); 484 482 485 483 st_sensors_power_disable(indio_dev); 486 484 487 485 iio_device_unregister(indio_dev); 488 - if (pdata->get_irq_data_ready(indio_dev) > 0) 486 + if (press_data->get_irq_data_ready(indio_dev) > 0) 489 487 st_sensors_deallocate_trigger(indio_dev); 490 488 491 489 st_press_deallocate_ring(indio_dev);
+5 -5
drivers/iio/pressure/st_pressure_i2c.c
··· 43 43 const struct i2c_device_id *id) 44 44 { 45 45 struct iio_dev *indio_dev; 46 - struct st_sensor_data *pdata; 46 + struct st_sensor_data *press_data; 47 47 int err; 48 48 49 - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*pdata)); 49 + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*press_data)); 50 50 if (!indio_dev) 51 51 return -ENOMEM; 52 52 53 - pdata = iio_priv(indio_dev); 54 - pdata->dev = &client->dev; 53 + press_data = iio_priv(indio_dev); 54 + press_data->dev = &client->dev; 55 55 st_sensors_of_i2c_probe(client, st_press_of_match); 56 56 57 - st_sensors_i2c_configure(indio_dev, client, pdata); 57 + st_sensors_i2c_configure(indio_dev, client, press_data); 58 58 59 59 err = st_press_common_probe(indio_dev); 60 60 if (err < 0)
+5 -5
drivers/iio/pressure/st_pressure_spi.c
··· 21 21 static int st_press_spi_probe(struct spi_device *spi) 22 22 { 23 23 struct iio_dev *indio_dev; 24 - struct st_sensor_data *pdata; 24 + struct st_sensor_data *press_data; 25 25 int err; 26 26 27 - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*pdata)); 27 + indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*press_data)); 28 28 if (indio_dev == NULL) 29 29 return -ENOMEM; 30 30 31 - pdata = iio_priv(indio_dev); 32 - pdata->dev = &spi->dev; 31 + press_data = iio_priv(indio_dev); 32 + press_data->dev = &spi->dev; 33 33 34 - st_sensors_spi_configure(indio_dev, spi, pdata); 34 + st_sensors_spi_configure(indio_dev, spi, press_data); 35 35 36 36 err = st_press_common_probe(indio_dev); 37 37 if (err < 0)