On Wed, Mar 28, 2012 at 04:33:50PM +0200, Thierry Reding wrote:
...
> +static struct pwm_ops tegra_pwm_ops = {

const

> +     .config = tegra_pwm_config,
> +     .enable = tegra_pwm_enable,
> +     .disable = tegra_pwm_disable,
> +     .owner = THIS_MODULE,
> +};
> +
> +static int tegra_pwm_probe(struct platform_device *pdev)
> +{
> +     struct tegra_pwm_chip *pwm;
> +     struct resource *r;
> +     int ret;
> +
> +     pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
> +     if (!pwm) {
> +             dev_err(&pdev->dev, "failed to allocate memory\n");
> +             return -ENOMEM;
> +     }
> +
> +     pwm->dev = &pdev->dev;
> +
> +     r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +     if (!r) {
> +             dev_err(&pdev->dev, "no memory resources defined\n");
> +             return -ENODEV;
> +     }
> +
> +     pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
> +     if (!pwm->mmio_base) {
> +             dev_err(&pdev->dev, "failed to ioremap() region\n");
> +             return -ENODEV;

The kernel doc of devm_request_and_ioremap() suggests -EADDRNOTAVAIL.

> +     }
> +

-- 
Regards,
Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to