Re: [PATCH v3 3/5] media: gscaler: Add core functionality for the G-Scaler driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shaik,

Thank you for addressing my comments.

On 07/25/2012 02:26 PM, Shaik Ameer Basha wrote:
> +static int gsc_probe(struct platform_device *pdev)
> +{
> +	struct gsc_dev *gsc;
> +	struct resource *res;
> +	struct gsc_driverdata *drv_data = gsc_get_drv_data(pdev);
> +	struct device *dev = &pdev->dev;
> +	int ret = 0;
> +
> +	gsc = devm_kzalloc(dev, sizeof(struct gsc_dev), GFP_KERNEL);
> +	if (!gsc)
> +		return -ENOMEM;
> +
> +	if (dev->of_node)
> +		gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc");
> +	else
> +		gsc->id = pdev->id;
> +
> +	if (gsc->id < 0 || gsc->id >= drv_data->num_entities) {
> +		dev_err(dev, "Invalid platform device id: %d\n", gsc->id);
> +		return -EINVAL;
> +	}
> +
> +	pdev->id = gsc->id;
> +	gsc->variant = drv_data->variant[gsc->id];
> +	gsc->pdev = pdev;
> +	gsc->pdata = dev->platform_data;
> +
> +	init_waitqueue_head(&gsc->irq_queue);
> +	spin_lock_init(&gsc->slock);
> +	mutex_init(&gsc->lock);
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	gsc->regs = devm_request_and_ioremap(dev, res);
> +	if (!gsc->regs) {
> +		dev_err(dev, "failed to map registers\n");
> +		return -ENOENT;
> +	}
> +
> +	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +	if (!res) {
> +		dev_err(dev, "failed to get IRQ resource\n");
> +		return -ENXIO;
> +	}
> +
> +	ret = gsc_clk_get(gsc);
> +	if (ret)
> +		return ret;
> +
> +	ret = devm_request_irq(dev, res->start, gsc_irq_handler,
> +				0, pdev->name, gsc);

One more small note, this should be:

		0, dev_name(&pdev->dev), gsc);

Then it's easier to identify which interrupts come from which
gscaler instance.


Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux