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
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to