Re: [PATCH] usb: gadget: #include device.h in gadget.h

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

 



On Wed, Jul 07, 2010 at 05:47:08PM -0700, Patrick Pannuto wrote:
> gadget.h uses structures defined in device.h, it must include it. In
> most cases, gadget.h is preceded by linux/platform_device.h, but if
> you are grouping headers sanely, device.h may not be pulled in until
> *after* gadget (e.g. mach/msm_device.h), thus gadget.h should not
> rely on something else #including device.h
> 
> include/linux/usb/gadget.h:488: error: field 'dev' has incomplete type

Why not just provide an "empty" prototype for whatever is needed.
Generally, having header files include header files is frowned apon, and
a number of people have been working on slowly unwinding a lot of this
type of mess that we currently have.

> include/linux/usb/gadget.h: In function 'set_gadget_data':
> include/linux/usb/gadget.h:492:
> 	error: implicit declaration of function 'dev_set_drvdata'

Ick, but then, this gets messier.

How about just fixing up the .c file that the problem happens in, to
include device.h first?  Is this an issue in the current tree somehow?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux