Re: [PATCH v4 4/5] mikrobus: Add mikroBUS driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Ayush Singh <ayushdevel1325@xxxxxxxxx>, Vaishnav M A <vaishnav@xxxxxxxxxxxxxxx>, devicetree@xxxxxxxxxxxxxxx, kernel-janitors@xxxxxxxxxxxxxxx, linux-spi@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, lorforlinux@xxxxxxxxxxxxxxx, greybus-dev@xxxxxxxxxxxxxxxx
- Subject: Re: [PATCH v4 4/5] mikrobus: Add mikroBUS driver
- From: Markus Elfring <Markus.Elfring@xxxxxx>
- Date: Mon, 18 Mar 2024 18:58:10 +0100
- In-reply-to: <20240317193714.403132-5-ayushdevel1325@gmail.com>
- References: <20240317193714.403132-5-ayushdevel1325@gmail.com>
- Ui-outboundreport: notjunk:1;M01:P0:ghagHPhdV3o=;yuht04V33nbPduIWJm5LROvF4bF /mLWU5oe42zYF7JLibuZkzWFb+gf+YmBIGHGdYu4UCfnOp1aiD+sRl3R7M76F3vkCAhgLNcOF YjrgrL7+payvk4Wh2j/YXEAp39TNY52nowu6jOq3so6bt55wnnr5IqPCqWTUA6dhWuzeAwgBY SCwBY2LDqW/iwYqiS+5uqWMvA47t+fIgy2ir9HyQBMjF/UUtv/cfjIft4uDta4ez6rPWaBBmh qaUoej3dKW0eeEUNPLLWqqasPR+aYU6deVd+jKgXBCDFV8J8nofHQiO0aosdcgnILhANO1boy jgUU6rkvVXubH6a6U7HQwbdKWNoi2Iy8gQ5PbyoQwlzWno8Yx4FJJKNv1saruY0/YAbamVukN u/CSjXJfPAseIQrjvH49stmGF7mDfANdB7bAvwpkdB8wbzOn4t8zRWLRfbDYXDuf592Qpd5eo 39pT6uzskfyulbIaJXoT/dGDq8ctIlTfqRSIGFfHYuCyxqA3HDTJVaY8s/cBK+RUqXcB5k+yW MAJmdQt3fCxZkTVTfPkzdNdL+5UnmM2uilI9Fuf7Gz9fRmTe+xl4aD+xqrnEr9ZepO0VLu9vF owmdMlWsWtxpofgSPasQq0DC3kgfG2amOqvHHIO0gFJYk7iXrJzp4RzkfWfhJIw/RglljeDdP w9aSMI+WiY6LOREuBw7/GjP/jhF4xDv0Upy68hS4CyIAXctr0/7OysI0PRa1iiRayjj7DhR4z 1HtmAUAxid+S57vX0IMxdlzb52Tfl0xs4rwm+MEh4WjqI8sQUReeKqpeAPExHAMVh831maXZV Hik+fmwx5psU57Jpl6tquYdXEHmYGXV+ZW7IKksyULOdc=
- User-agent: Mozilla Thunderbird
…
> +++ b/drivers/misc/mikrobus/mikrobus_core.c
…
> +static int mikrobus_pinctrl_setup(struct mikrobus_port *port,
> + struct addon_board_info *board)
> +{
> + int ret;
> +
> + if (!board || board->pin_state[MIKROBUS_PIN_PWM] == MIKROBUS_STATE_PWM)
> + ret = mikrobus_pinctrl_select(port, "pwm_default");
> + else
> + ret = mikrobus_pinctrl_select(port, "pwm_gpio");
…
How do you think about to avoid the specification of a bit of duplicate source code here
by using conditional operator expressions?
ret = mikrobus_pinctrl_select(port,
((!board ||
board->pin_state[MIKROBUS_PIN_PWM] == MIKROBUS_STATE_PWM)
? "pwm_default"
: "pwm_gpio"));
Regards,
Markus
_______________________________________________
greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx
[Index of Archives]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]
[Asterisk Books]