[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48819894-4943-7d14-ccf8-83cfd2195c9a@cogentembedded.com>
Date: Wed, 17 May 2017 08:43:34 +0300
From: Nikita Yushchenko <nikita.yoush@...entembedded.com>
To: Dong Aisheng <dongas86@...il.com>
Cc: Dong Aisheng <aisheng.dong@....com>, linux-serial@...r.kernel.org,
fugang.duan@....com, gregkh@...uxfoundation.org, yangbo.lu@....com,
linux-kernel@...r.kernel.org, stefan@...er.ch, Mingkai.Hu@....com,
jslaby@...e.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [V2, 2/6] tty: serial: lpuart: add little endian 32 bit register
support
>>> @@ -2000,6 +2007,7 @@ static int lpuart_probe(struct platform_device *pdev)
>>> }
>>> sport->port.line = ret;
>>> sport->lpuart32 = sdata->is_32;
>>> + lpuart_is_be = sdata->is_be;
>>
>> Setting a global variable in per-device routine is quite bad design.
>>
>
> There is a reason for that we don't want to change the exist
> lpuart32_read[write] API which is widely used in driver.
> Making a global lpuart_is_be is the simplest way to do it.
>
> Any strong blocking reason?
Code should be consistent.
There is no good reason to have sport->lpuart32 inside sport, but
lpuart_is_be outside of it. Both these values describe properties of
particular device, and thus should be in per-device structure.
If that implies adding sport arg to lpuart32_(read|write), just do that.
Powered by blists - more mailing lists