aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-08-19 18:43:00 -0400
committerJonathan Cameron <jic23@kernel.org>2014-09-14 15:19:52 -0400
commitb9a6a237ffc99f63fd96f3ad11b3c5c532d211f8 (patch)
tree9b28ed5b63146e7e8e623dc49b7cb5d1935f2e7a
parentb81fbab7f567aaa12aba6532681b426f3e130e11 (diff)
iio:bma180: Drop _update_scan_mode()
statically allocate maximum size Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/accel/bma180.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 91260a071fe9..583831898247 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -82,7 +82,7 @@ struct bma180_data {
82 int scale; 82 int scale;
83 int bw; 83 int bw;
84 bool pmode; 84 bool pmode;
85 char *buff; 85 u8 buff[16]; /* 3x 16-bit + 8-bit + padding + timestamp */
86}; 86};
87 87
88enum bma180_chan { 88enum bma180_chan {
@@ -408,26 +408,10 @@ static int bma180_write_raw(struct iio_dev *indio_dev,
408 } 408 }
409} 409}
410 410
411static int bma180_update_scan_mode(struct iio_dev *indio_dev,
412 const unsigned long *scan_mask)
413{
414 struct bma180_data *data = iio_priv(indio_dev);
415
416 if (data->buff)
417 devm_kfree(&indio_dev->dev, data->buff);
418 data->buff = devm_kzalloc(&indio_dev->dev,
419 indio_dev->scan_bytes, GFP_KERNEL);
420 if (!data->buff)
421 return -ENOMEM;
422
423 return 0;
424}
425
426static const struct iio_info bma180_info = { 411static const struct iio_info bma180_info = {
427 .attrs = &bma180_attrs_group, 412 .attrs = &bma180_attrs_group,
428 .read_raw = bma180_read_raw, 413 .read_raw = bma180_read_raw,
429 .write_raw = bma180_write_raw, 414 .write_raw = bma180_write_raw,
430 .update_scan_mode = bma180_update_scan_mode,
431 .driver_module = THIS_MODULE, 415 .driver_module = THIS_MODULE,
432}; 416};
433 417