Re: [PATCH v2] video: add OpenCores VGA/LCD framebuffer driver

From: Jingoo Han
Date: Wed Nov 20 2013 - 01:20:34 EST


On Wednesday, November 20, 2013 1:14 PM, Stefan Kristiansson wrote:
>
> This adds support for the VGA/LCD core available from OpenCores:
> http://opencores.org/project,vga_lcd
>
> The driver have been tested together with both OpenRISC and
> ARM (socfpga) processors.
>
> Signed-off-by: Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Add Microblaze as an example user and fix a typo in Xilinx Zynq
> ---
> drivers/video/Kconfig | 17 ++
> drivers/video/Makefile | 1 +
> drivers/video/ocfb.c | 479 +++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 497 insertions(+)
> create mode 100644 drivers/video/ocfb.c
>

Hi Stefan Kristiansson,

I added trivial comments as below.

[.....]

> --- /dev/null
> +++ b/drivers/video/ocfb.c

[.....]

> +static int ocfb_probe(struct platform_device *pdev)
> +{
> + int ret = 0;
> + struct ocfb_dev *fbdev;
> + struct ocfb_par *par = &ocfb_par_priv;
> + struct resource *res;
> + struct resource *mmio;
> + int fbsize;
> +
> + fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);

Please use devm_kzalloc() instead of kzalloc().
In this case, kfree() can be removed from ocfb_probe()
and ocfb_remove(). Thus, it will make the code smaller.

[.....]

> +
> +#ifdef MODULE

I don't think that '#ifdef MODULE' is necessary.
Is there any reason?

Best regards,
Jingoo Han

> +MODULE_AUTHOR("Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>");
> +MODULE_DESCRIPTION("OpenCores VGA/LCD 2.0 frame buffer driver");
> +MODULE_LICENSE("GPL v2");
> +module_param(mode_option, charp, 0);
> +MODULE_PARM_DESC(mode_option, "Video mode ('<xres>x<yres>[-<bpp>][@refresh]')");
> +#endif
> --
> 1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/