[PATCH] libertas: provide reset_card() callback on OLPC

David Woodhouse dwmw2 at infradead.org
Wed May 21 04:21:11 EDT 2008


On Wed, 2008-05-21 at 09:18 +0200, Holger Schurig wrote:
> > +#ifdef CONFIG_OLPC
> > +	if (machine_is_olpc())
> > +		priv->reset_card = if_usb_reset_olpc_card;
> > +#endif
> 
> 
> If you have in some header:
> 
> #ifndef CONFIG_OLPC
> #define if_usb_reset_olpc_card (0)
> #define machine_is_olpc() (0)
> #endif
> 
> Then you should be able to write
> 
>    if (machine_is_olpc())
>          priv->reset_card = if_usb_reset_olpc_card;
> 
> without any more ulgy #ifdef's.

Yeah, that makes sense.

> > +		if_usb_reset_olpc_card(NULL);
> 
> Why do you call this function with priv==NULL, when 
> if_usb_reset_olpc_card() doesn't even use NULL, err, " struct 
> lbs_private *priv" in if_usb_reset_olpc_card() ?!?!

You're asking why the ->reset_card() callback even has an argument at
all? If we implement it elsewhere, it'll want that. We just happen not
to use it for USB (yet. If we can actually power down the port and power
it up again, we might want to do that).

-- 
dwmw2




More information about the libertas-dev mailing list