[PATCH 1/3] ohci-at91: add vbus_pin_inverted platform attribute

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jul 5 07:54:55 EDT 2011


Le Tue, 05 Jul 2011 15:39:18 +0400,
Sergei Shtylyov <sshtylyov at mvista.com> a écrit :

> > -			gpio_direction_output(pdata->vbus_pin[i], 0);
> > +			gpio_direction_output(pdata->vbus_pin[i], 0 ^ pdata->vbus_pin_inverted);
> 
>     Why not simply 'pdata->vbus_pin_inverted'?

> > -			gpio_direction_output(pdata->vbus_pin[i], 1);
> > +			gpio_direction_output(pdata->vbus_pin[i], 1 ^ pdata->vbus_pin_inverted);
> 
>     Why not simply '!pdata->vbus_pin_inverted'?

Ah, correct. The 0 and 1 were present before, and I just wanted to xor
them with vbus_pin_inverted, but obviously, there's a simpler way of
writing things, as you suggest.

I'll update my patch and send a new version after gathering comments
from other reviewers.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the linux-arm-kernel mailing list