[PATCH 5/6] ARM: mxc: add dt support for audmux-v2

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Jan 6 03:56:17 EST 2012


On Fri, Jan 06, 2012 at 11:25:42AM +0800, Richard Zhao wrote:
> +#ifdef CONFIG_OF
> +
> +static int audmux_v2_probe(struct platform_device *pdev)
> +{
> +	struct resource *res;
> +	int ret = 0;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res)
> +		return -ENODEV;
> +	if (!request_mem_region(res->start, resource_size(res), "audmux_v2")) {
> +		dev_err(&pdev->dev, "request_mem_region failed\n");
> +		return -EBUSY;
> +	}
> +
> +	audmux_base = ioremap(res->start, resource_size(res));
> +	if (!audmux_base) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENODEV;
> +		goto failed_ioremap;
> +	}
> +
> +	audmux_clk = clk_get(NULL, "audmux");

NAK.  You have a struct device.  Use it.



More information about the linux-arm-kernel mailing list