Re: [PATCH V2 04/17] staging: wilc1000: wilc_wlan_cfg_set: add argument struct net_device

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

 



On Thu, Nov 05, 2015 at 10:39:59AM +0900, glen lee wrote:
> >>+int wilc_wlan_cfg_set(struct net_device *dev, int start, u32 wid, u8 *buffer,
> >>+		      u32 buffer_size, int commit, u32 drvHandler)
> >>  {
> >>  	wilc_wlan_dev_t *p = &g_wlan;
> >>  	u32 offset;
> >>  	int ret_size;
> >>+	perInterface_wlan_t *nic = netdev_priv(dev);
> >>+	struct wilc *wilc;
> >>+	wilc = nic->wilc;
> >Again here, pass in a struct wilc *.
> 
> Thank you for your advise,
> I can use local structure wilc as you said but there are print line inside the function.
> The custom print lines will be changed with netdev_xxx format later, so I need to pass dev if necessary.
> I used wilc if net_device is unnecessary or unavailable.
> For this reason, Is this OK to use net_device if it is necessary?

You have a pointer to net_device in struct wilc, right?  Use that
pointer when you need it, wilc is your "primary" thing, not struct
net_device, to pass around.  You should never have to cast back and
forth when calling internal functions like this.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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