[PATCH 2/4] pinmux: add a driver for the U300 pinmux

Josh Cartwright joshc at linux.com
Tue May 10 22:47:09 EDT 2011


On Mon, May 02, 2011 at 09:16:38PM +0200, Linus Walleij wrote:
[]
> +
> +static int __init u300_pmx_probe(struct platform_device *pdev)
> +{
[]
> +	upmx->phybase = res->start;
> +	upmx->physize = resource_size(res);
> +
> +	if (request_mem_region(upmx->phybase, upmx->physize,
> +			       DRIVER_NAME) == NULL) {
> +		ret = -EBUSY;
> +		goto out_no_memregion;
> +	}
> +
> +	upmx->virtbase = ioremap(upmx->phybase, upmx->physize);
> +	if (!upmx->virtbase) {
> +		ret = -ENOMEM;
> +		goto out_no_remap;
> +	}
> +
> +	upmx->pmx = pinmux_register(&u300_pmx_desc, &pdev->dev, upmx);
> +	if (IS_ERR(upmx->pmx)) {
> +		ret = PTR_ERR(upmx->pmx);
> +		goto out_no_pmx;
> +	}
> +	platform_set_drvdata(pdev, upmx);
> +
> +	dev_info(&pdev->dev, "initialized U300 pinmux driver\n");
> +
> +	return 0;
> +
> +out_no_pmx:
> +	iounmap(upmx->virtbase);
> +out_no_remap:
> +	platform_set_drvdata(pdev, NULL);
> +out_no_memregion:
> +	release_mem_region(upmx->phybase, SZ_4K);

release_mem_region(upmx->phybase, upmx->physize); ?

-- 
                           joshc



More information about the linux-arm-kernel mailing list