From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752685AbdEQFnj (ORCPT ); Wed, 17 May 2017 01:43:39 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36065 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbdEQFnh (ORCPT ); Wed, 17 May 2017 01:43:37 -0400 Subject: Re: [V2, 2/6] tty: serial: lpuart: add little endian 32 bit register support To: Dong Aisheng References: <1494834539-17523-3-git-send-email-aisheng.dong@nxp.com> <20170517033139.GB9913@b29396-OptiPlex-7040> Cc: Dong Aisheng , linux-serial@vger.kernel.org, fugang.duan@nxp.com, gregkh@linuxfoundation.org, yangbo.lu@nxp.com, linux-kernel@vger.kernel.org, stefan@agner.ch, Mingkai.Hu@nxp.com, jslaby@suse.com, linux-arm-kernel@lists.infradead.org From: Nikita Yushchenko X-Enigmail-Draft-Status: N1110 Message-ID: <48819894-4943-7d14-ccf8-83cfd2195c9a@cogentembedded.com> Date: Wed, 17 May 2017 08:43:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170517033139.GB9913@b29396-OptiPlex-7040> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> @@ -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.