]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/staging/iio/accel/sca3000_core.c
Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[mirror_ubuntu-artful-kernel.git] / drivers / staging / iio / accel / sca3000_core.c
index 311c8a125ee3a8e70294da8e1fd7269a684dd2aa..02e930c55570237817e24c629b3f7df11fbd1fdd 100644 (file)
@@ -88,7 +88,7 @@ int sca3000_write_reg(struct sca3000_state *st, u8 address, u8 val)
 }
 
 int sca3000_read_data_short(struct sca3000_state *st,
-                           uint8_t reg_address_high,
+                           u8 reg_address_high,
                            int len)
 {
        struct spi_transfer xfer[2] = {
@@ -165,10 +165,9 @@ static int __sca3000_unlock_reg_lock(struct sca3000_state *st)
  * Lock must be held.
  **/
 static int sca3000_write_ctrl_reg(struct sca3000_state *st,
-                                 uint8_t sel,
+                                 u8 sel,
                                  uint8_t val)
 {
-
        int ret;
 
        ret = sca3000_reg_lock_on(st);
@@ -374,7 +373,6 @@ error_ret:
        return ret;
 }
 
-
 /*
  * Not even vaguely standard attributes so defined here rather than
  * in the relevant IIO core headers
@@ -476,7 +474,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
                } else {
                        /* get the temperature when available */
                        ret = sca3000_read_data_short(st,
-                               SCA3000_REG_ADDR_TEMP_MSB, 2);
+                                                     SCA3000_REG_ADDR_TEMP_MSB,
+                                                     2);
                        if (ret < 0) {
                                mutex_unlock(&st->lock);
                                return ret;
@@ -511,8 +510,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
  * at all.
  **/
 static ssize_t sca3000_read_av_freq(struct device *dev,
-                            struct device_attribute *attr,
-                            char *buf)
+                                   struct device_attribute *attr,
+                                   char *buf)
 {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
@@ -549,6 +548,7 @@ static ssize_t sca3000_read_av_freq(struct device *dev,
 error_ret:
        return ret;
 }
+
 /**
  * __sca3000_get_base_freq() obtain mode specific base frequency
  *
@@ -582,8 +582,8 @@ error_ret:
  * sca3000_read_frequency() sysfs interface to get the current frequency
  **/
 static ssize_t sca3000_read_frequency(struct device *dev,
-                              struct device_attribute *attr,
-                              char *buf)
+                                     struct device_attribute *attr,
+                                     char *buf)
 {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
@@ -623,9 +623,9 @@ error_ret:
  * sca3000_set_frequency() sysfs interface to set the current frequency
  **/
 static ssize_t sca3000_set_frequency(struct device *dev,
-                             struct device_attribute *attr,
-                             const char *buf,
-                             size_t len)
+                                    struct device_attribute *attr,
+                                    const char *buf,
+                                    size_t len)
 {
        struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct sca3000_state *st = iio_priv(indio_dev);
@@ -849,9 +849,9 @@ static int sca3000_read_event_config(struct iio_dev *indio_dev,
        if (ret)
                goto error_ret;
 
-       if ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET)
+       if ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET) {
                ret = 0;
-       else {
+       else {
                ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_MD_CTRL);
                if (ret < 0)
                        goto error_ret;
@@ -863,6 +863,7 @@ error_ret:
 
        return ret;
 }
+
 /**
  * sca3000_query_free_fall_mode() is free fall mode enabled
  **/
@@ -979,14 +980,14 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev,
        if (ret)
                goto exit_point;
        /* if off and should be on */
-       if ((st->mo_det_use_count)
-           && ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET))
+       if ((st->mo_det_use_count) &&
+           ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET))
                ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
                                        (st->rx[0] & ~protect_mask)
                                        | SCA3000_MEAS_MODE_MOT_DET);
        /* if on and should be off */
-       else if (!(st->mo_det_use_count)
-                && ((st->rx[0] & protect_mask) == SCA3000_MEAS_MODE_MOT_DET))
+       else if (!(st->mo_det_use_count) &&
+                ((st->rx[0] & protect_mask) == SCA3000_MEAS_MODE_MOT_DET))
                ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
                                        (st->rx[0] & ~protect_mask));
 exit_point:
@@ -1196,7 +1197,6 @@ MODULE_DEVICE_TABLE(spi, sca3000_id);
 static struct spi_driver sca3000_driver = {
        .driver = {
                .name = "sca3000",
-               .owner = THIS_MODULE,
        },
        .probe = sca3000_probe,
        .remove = sca3000_remove,