Re: [PATCH 1/4] staging: vme: add struct vme_dev for VME devices

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

 



On Mon, Sep 26, 2011 at 11:27:15 +0200, Manohar Vanga wrote:
(snip)
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index 810fe1f..76e08f3 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
(snip)
> @@ -1358,26 +1355,29 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  	 * specification.
>  	 */
>  	for (i = 0; i < VME_SLOTS_MAX; i++) {
> -		bridge->dev[i] = kzalloc(sizeof(struct device), GFP_KERNEL);
> +		bridge->dev[i] = kzalloc(sizeof(struct vme_dev), GFP_KERNEL);
>  		if (!bridge->dev[i]) {
>  			retval = -ENOMEM;
>  			goto err_devalloc;
>  		}
> -		dev = bridge->dev[i];
> -		memset(dev, 0, sizeof(struct device));
> -
> -		dev->parent = bridge->parent;
> -		dev->bus = &vme_bus_type;
> -		dev->release = vme_dev_release;
> +		vdev = bridge->dev[i];
> +		memset(vdev, 0, sizeof(struct vme_dev));

minor nit, in fact removed in patch 2: memset here is redundant
(see kzalloc above).

The rest looks good.

		Emilio
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux