[PATCH 1/4] usb: gadget: at91-udc: simplify at91rm9200_udc_pullup callback

Claudiu.Beznea at microchip.com Claudiu.Beznea at microchip.com
Fri Nov 4 01:07:14 PDT 2022


On 03.11.2022 21:57, Michael Grzeschik wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Just simplify the use of is_on and get rid of superfluous condition.
> 
> Cc: gregkh at linuxfoundation.org
> Cc: nicolas.ferre at microchip.com
> Cc: alexandre.belloni at bootlin.com
> Cc: linux-usb at vger.kernel.org
> Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>

Reviewed-by: Claudiu Beznea <claudiu.beznea at microchip.com>


> ---
>  drivers/usb/gadget/udc/at91_udc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c
> index a9a7b3fc60ec96..922b4187004b03 100644
> --- a/drivers/usb/gadget/udc/at91_udc.c
> +++ b/drivers/usb/gadget/udc/at91_udc.c
> @@ -1628,10 +1628,7 @@ static int at91rm9200_udc_init(struct at91_udc *udc)
> 
>  static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on)
>  {
> -       if (is_on)
> -               gpiod_set_value(udc->board.pullup_pin, 1);
> -       else
> -               gpiod_set_value(udc->board.pullup_pin, 0);
> +       gpiod_set_value(udc->board.pullup_pin, is_on);
>  }
> 
>  static const struct at91_udc_caps at91rm9200_udc_caps = {
> --
> 2.30.2
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list