pwm: twl-led: Make use of pwmchip_parent() accessor
[linux-2.6-microblaze.git] / drivers / pwm / pwm-twl-led.c
index c670ccb..00ef798 100644 (file)
@@ -100,7 +100,7 @@ static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
 
        ret = twl_i2c_write(TWL4030_MODULE_LED, pwm_config, base, 2);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to configure PWM\n", pwm->label);
 
        return ret;
 }
@@ -114,7 +114,7 @@ static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL4030_MODULE_LED, &val, TWL4030_LEDEN_REG);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to read LEDEN\n", pwm->label);
                goto out;
        }
 
@@ -122,7 +122,7 @@ static int twl4030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 
        ret = twl_i2c_write_u8(TWL4030_MODULE_LED, val, TWL4030_LEDEN_REG);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to enable PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);
@@ -139,7 +139,7 @@ static void twl4030_pwmled_disable(struct pwm_chip *chip,
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL4030_MODULE_LED, &val, TWL4030_LEDEN_REG);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read LEDEN\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to read LEDEN\n", pwm->label);
                goto out;
        }
 
@@ -147,7 +147,7 @@ static void twl4030_pwmled_disable(struct pwm_chip *chip,
 
        ret = twl_i2c_write_u8(TWL4030_MODULE_LED, val, TWL4030_LEDEN_REG);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to disable PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);
@@ -203,7 +203,7 @@ static int twl6030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
        ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, on_time,
                               TWL6030_LED_PWM_CTRL1);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to configure PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to configure PWM\n", pwm->label);
 
        return ret;
 }
@@ -217,7 +217,7 @@ static int twl6030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL6030_MODULE_ID1, &val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read PWM_CTRL2\n",
+               dev_err(pwmchip_parent(chip), "%s: Failed to read PWM_CTRL2\n",
                        pwm->label);
                goto out;
        }
@@ -227,7 +227,7 @@ static int twl6030_pwmled_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 
        ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to enable PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to enable PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);
@@ -244,7 +244,7 @@ static void twl6030_pwmled_disable(struct pwm_chip *chip,
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL6030_MODULE_ID1, &val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read PWM_CTRL2\n",
+               dev_err(pwmchip_parent(chip), "%s: Failed to read PWM_CTRL2\n",
                        pwm->label);
                goto out;
        }
@@ -254,7 +254,7 @@ static void twl6030_pwmled_disable(struct pwm_chip *chip,
 
        ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to disable PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);
@@ -295,7 +295,7 @@ static int twl6030_pwmled_request(struct pwm_chip *chip, struct pwm_device *pwm)
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL6030_MODULE_ID1, &val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read PWM_CTRL2\n",
+               dev_err(pwmchip_parent(chip), "%s: Failed to read PWM_CTRL2\n",
                        pwm->label);
                goto out;
        }
@@ -305,7 +305,7 @@ static int twl6030_pwmled_request(struct pwm_chip *chip, struct pwm_device *pwm)
 
        ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to request PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to request PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);
@@ -321,7 +321,7 @@ static void twl6030_pwmled_free(struct pwm_chip *chip, struct pwm_device *pwm)
        mutex_lock(&twl->mutex);
        ret = twl_i2c_read_u8(TWL6030_MODULE_ID1, &val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0) {
-               dev_err(chip->dev, "%s: Failed to read PWM_CTRL2\n",
+               dev_err(pwmchip_parent(chip), "%s: Failed to read PWM_CTRL2\n",
                        pwm->label);
                goto out;
        }
@@ -331,7 +331,7 @@ static void twl6030_pwmled_free(struct pwm_chip *chip, struct pwm_device *pwm)
 
        ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_LED_PWM_CTRL2);
        if (ret < 0)
-               dev_err(chip->dev, "%s: Failed to free PWM\n", pwm->label);
+               dev_err(pwmchip_parent(chip), "%s: Failed to free PWM\n", pwm->label);
 
 out:
        mutex_unlock(&twl->mutex);