static int nuc970_pwm_remove(struct platform_device *pdev) { struct nuc970_chip *nuc970 = platform_get_drvdata(pdev); clk_disable(nuc970->clk); return pwmchip_remove(&nuc970->chip); }
static int brcmstb_pwm_remove(struct platform_device *pdev) { struct brcmstb_pwm *p = platform_get_drvdata(pdev); int ret; ret = pwmchip_remove(&p->chip); clk_disable_unprepare(p->clk); return ret; }
static int lpc32xx_pwm_remove(struct platform_device *pdev) { struct lpc32xx_pwm_chip *lpc32xx = platform_get_drvdata(pdev); unsigned int i; for (i = 0; i < lpc32xx->chip.npwm; i++) pwm_disable(&lpc32xx->chip.pwms[i]); return pwmchip_remove(&lpc32xx->chip); }
static int vt8500_pwm_remove(struct platform_device *pdev) { struct vt8500_chip *chip; chip = platform_get_drvdata(pdev); if (chip == NULL) return -ENODEV; clk_unprepare(chip->clk); return pwmchip_remove(&chip->chip); }
static int tpu_remove(struct platform_device *pdev) { struct tpu_device *tpu = platform_get_drvdata(pdev); int ret; ret = pwmchip_remove(&tpu->chip); if (ret) return ret; pm_runtime_disable(&pdev->dev); return 0; }
static int s3c_pwm_remove(struct platform_device *pdev) { struct s3c_chip *s3c = platform_get_drvdata(pdev); int err; err = pwmchip_remove(&s3c->chip); if (err < 0) return err; clk_disable_unprepare(s3c->clk); return 0; }
static int mxs_pwm_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct mxs_pwm_chip *mxs; struct resource *res; int ret; mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); if (!mxs) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mxs->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(mxs->base)) return PTR_ERR(mxs->base); mxs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(mxs->clk)) return PTR_ERR(mxs->clk); mxs->chip.dev = &pdev->dev; mxs->chip.ops = &mxs_pwm_ops; mxs->chip.base = -1; 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); return ret; } ret = pwmchip_add(&mxs->chip); if (ret < 0) { dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret); return ret; } platform_set_drvdata(pdev, mxs); ret = stmp_reset_block(mxs->base); if (ret) goto pwm_remove; return 0; pwm_remove: pwmchip_remove(&mxs->chip); return ret; }
static int mxs_pwm_remove(struct platform_device *pdev) { struct mxs_pwm_chip *mxs = platform_get_drvdata(pdev); return pwmchip_remove(&mxs->chip); }
static int sunxi_pwm_remove(struct platform_device *pdev) { struct sunxi_pwm_chip *pwm = platform_get_drvdata(pdev); return pwmchip_remove(&pwm->chip); }
static int twl6030_pwm_remove(struct platform_device *pdev) { struct twl6030_pwm_chip *twl6030 = platform_get_drvdata(pdev); return pwmchip_remove(&twl6030->chip); }