Skip to content

Commit

Permalink
pwm: Remove .can_sleep from struct pwm_chip
Browse files Browse the repository at this point in the history
All PWM devices have been marked as "might sleep" since v4.5, there is
no longer a need to differentiate on a per-chip basis.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
thierryreding committed Jan 4, 2017
1 parent fe2858c commit 8c0216f
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion drivers/pwm/pwm-atmel-hlcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)
chip->chip.npwm = 1;
chip->chip.of_xlate = of_pwm_xlate_with_flags;
chip->chip.of_pwm_n_cells = 3;
chip->chip.can_sleep = 1;

ret = pwmchip_add_with_polarity(&chip->chip, PWM_POLARITY_INVERSED);
if (ret) {
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ static int atmel_pwm_probe(struct platform_device *pdev)

atmel_pwm->chip.base = -1;
atmel_pwm->chip.npwm = 4;
atmel_pwm->chip.can_sleep = true;
atmel_pwm->config = data->config;
atmel_pwm->updated_pwms = 0;
mutex_init(&atmel_pwm->isr_lock);
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-bcm-kona.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ static int kona_pwmc_probe(struct platform_device *pdev)
kp->chip.npwm = 6;
kp->chip.of_xlate = of_pwm_xlate_with_flags;
kp->chip.of_pwm_n_cells = 3;
kp->chip.can_sleep = true;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
kp->base = devm_ioremap_resource(&pdev->dev, res);
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-berlin.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ static int berlin_pwm_probe(struct platform_device *pdev)
pwm->chip.ops = &berlin_pwm_ops;
pwm->chip.base = -1;
pwm->chip.npwm = 4;
pwm->chip.can_sleep = true;
pwm->chip.of_xlate = of_pwm_xlate_with_flags;
pwm->chip.of_pwm_n_cells = 3;

Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-brcmstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ static int brcmstb_pwm_probe(struct platform_device *pdev)
p->chip.ops = &brcmstb_pwm_ops;
p->chip.base = -1;
p->chip.npwm = 2;
p->chip.can_sleep = true;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
p->base = devm_ioremap_resource(&pdev->dev, res);
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-fsl-ftm.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ static int fsl_pwm_probe(struct platform_device *pdev)
fpc->chip.of_pwm_n_cells = 3;
fpc->chip.base = -1;
fpc->chip.npwm = 8;
fpc->chip.can_sleep = true;

ret = pwmchip_add(&fpc->chip);
if (ret < 0) {
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ static int imx_pwm_probe(struct platform_device *pdev)
imx->chip.dev = &pdev->dev;
imx->chip.base = -1;
imx->chip.npwm = 1;
imx->chip.can_sleep = true;

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-lp3943.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ static int lp3943_pwm_probe(struct platform_device *pdev)
lp3943_pwm->chip.dev = &pdev->dev;
lp3943_pwm->chip.ops = &lp3943_pwm_ops;
lp3943_pwm->chip.npwm = LP3943_NUM_PWMS;
lp3943_pwm->chip.can_sleep = true;

platform_set_drvdata(pdev, lp3943_pwm);

Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
mxs->chip.dev = &pdev->dev;
mxs->chip.ops = &mxs_pwm_ops;
mxs->chip.base = -1;
mxs->chip.can_sleep = true;

ret = of_property_read_u32(np, "fsl,pwm-number", &mxs->chip.npwm);
if (ret < 0) {
dev_err(&pdev->dev, "failed to get pwm number: %d\n", ret);
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-pca9685.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ static int pca9685_pwm_probe(struct i2c_client *client,

pca->chip.dev = &client->dev;
pca->chip.base = -1;
pca->chip.can_sleep = true;

return pwmchip_add(&pca->chip);
}
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-sti.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ static int sti_pwm_probe(struct platform_device *pdev)
pc->chip.ops = &sti_pwm_ops;
pc->chip.base = -1;
pc->chip.npwm = pc->cdata->pwm_num_devs;
pc->chip.can_sleep = true;

ret = pwmchip_add(&pc->chip);
if (ret < 0) {
Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-sun4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
pwm->chip.ops = &sun4i_pwm_ops;
pwm->chip.base = -1;
pwm->chip.npwm = pwm->data->npwm;
pwm->chip.can_sleep = true;
pwm->chip.of_xlate = of_pwm_xlate_with_flags;
pwm->chip.of_pwm_n_cells = 3;

Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-twl-led.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ static int twl_pwmled_probe(struct platform_device *pdev)

twl->chip.dev = &pdev->dev;
twl->chip.base = -1;
twl->chip.can_sleep = true;

mutex_init(&twl->mutex);

Expand Down
1 change: 0 additions & 1 deletion drivers/pwm/pwm-twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ static int twl_pwm_probe(struct platform_device *pdev)
twl->chip.dev = &pdev->dev;
twl->chip.base = -1;
twl->chip.npwm = 2;
twl->chip.can_sleep = true;

mutex_init(&twl->mutex);

Expand Down
1 change: 0 additions & 1 deletion drivers/staging/greybus/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ static int gb_pwm_probe(struct gbphy_device *gbphy_dev,
pwm->ops = &gb_pwm_ops;
pwm->base = -1; /* Allocate base dynamically */
pwm->npwm = pwmc->pwm_max + 1;
pwm->can_sleep = true; /* FIXME */

ret = pwmchip_add(pwm);
if (ret) {
Expand Down
3 changes: 0 additions & 3 deletions include/linux/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ struct pwm_ops {
* @pwms: array of PWM devices allocated by the framework
* @of_xlate: request a PWM device given a device tree PWM specifier
* @of_pwm_n_cells: number of cells expected in the device tree PWM specifier
* @can_sleep: must be true if the .config(), .enable() or .disable()
* operations may sleep
*/
struct pwm_chip {
struct device *dev;
Expand All @@ -302,7 +300,6 @@ struct pwm_chip {
struct pwm_device * (*of_xlate)(struct pwm_chip *pc,
const struct of_phandle_args *args);
unsigned int of_pwm_n_cells;
bool can_sleep;
};

/**
Expand Down

0 comments on commit 8c0216f

Please sign in to comment.