From patchwork Mon Sep 17 18:33:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146855 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099669ljw; Mon, 17 Sep 2018 11:34:24 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb/u5+UZYTbA6IPuDJpnuvC5TODTP81mwGNupN9U0GO3hXym5hW5nrztWEelAmotyieLL3M X-Received: by 2002:a17:902:5a4e:: with SMTP id f14-v6mr26307615plm.311.1537209264545; Mon, 17 Sep 2018 11:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209264; cv=none; d=google.com; s=arc-20160816; b=BqryQg0ZpMdaRM5I4eS5t54pgJPR8d+KddKMGdEk8/mGxrfIbiV/R9ZHtUO2zDdzYR dj1znxQgdsmC0gTg3Ybns+cVvtGqegblSNZT1nGsbH5HY5uq8kimvw1gRPvHXnJ5U1pz /OkVhNz83tdSKE3G21s5cdboPiJ/SW62yTX8BSWPGsApUTmyfCnrQpCURCC3J68UqpMY LuGZpz/Eda6h+xEiCXmPwtq9DttzMpDIt8CO/OmHXfOoQAuX3d2GvGifOQHBi1H6Mu9Y qg+VWSSu57bwL+jVGrPj6B3SJSuW/AoyjjmO/9t8XomaLHlO0iaMR0scPaWYsI53lmI1 Uj/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GPxEOjtjRb5FzIdtwFMOhqaLT0uUhzQCKrA3nsjl2UM=; b=1IugM3G0TKQuKgeRuNFzIiCEaFZLI+5reuNHjDkOHFFysHjMsY4098lKiIPrr1OKqS eBszixD7W9kN287rxiqKk1rzN4wEyho7dYx76VjroYXnVqoI0d+STze8gMc1TYi8ieKQ 3x6XWSQyTLmmj1Q8L2JLwt2ZoJcX96ZxhZE0Ef0xuEFKZOTn9achhG1ig/g5z+9V+Qau e2gG0Ce1G7rNsrPwIIekLGMibhyMBhxyfb2VKtVg/1kfgo2wCor9Ll3536OMv1ZXSm1x O5vNHotOKXvTWqIu9q/NzXb/evWCdLtV8lwDuQpUBVdQZfr5Qwy89pt+BIIsP+pUaMXo H6Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LDxk0VVu; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b38-v6si17927652plb.167.2018.09.17.11.34.24; Mon, 17 Sep 2018 11:34:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LDxk0VVu; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbeIRAC4 (ORCPT + 2 others); Mon, 17 Sep 2018 20:02:56 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35751 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbeIRACz (ORCPT ); Mon, 17 Sep 2018 20:02:55 -0400 Received: by mail-pl1-f195.google.com with SMTP id g2-v6so7826736plo.2 for ; Mon, 17 Sep 2018 11:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GPxEOjtjRb5FzIdtwFMOhqaLT0uUhzQCKrA3nsjl2UM=; b=LDxk0VVu4RiRG7HKW0CeBYwPe4dcYUz7oEyIvNYHOUOK/aJtzhYDWUWsRiDKVwAB8b fwnjoqOfMEEatUdPVmvK9tljLc8ScbAtcATHbG7p/4TZGXN8eZ6Apn1tdykLbTRocwRP VzzkQdwJU/z2CynrQLIPzv1Nd0z1WfJTJ48x0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GPxEOjtjRb5FzIdtwFMOhqaLT0uUhzQCKrA3nsjl2UM=; b=Y0SwgWg6I6bc/nrRgOsgryhkQKEcPhEJcB7huzkqjkdLGTV8AU4DXX6jPiHqbvSuTB YVO6WBpTyMTWivuKThTE+8DeJNchJIFd/ePOxoNAxZAJrhbeHGBDu0z8BABDelqVU6Is Qp5zBKcufMNqKdMnfIf+dVNYsrDUcIYL4wBdOumnlf4lLYYf6sfbI1Cswe6g8UocxgPo 75q4lCQjVCW8ykGHS4HMU6/2J5gxsx8diA2kzrhk0YjyjJBEPKbjdiTlsIKBXVZo9xRs Z6HkLdyNHQ6qadLJheZ/7rcNaeIR12zZQ6EJ4IdhLq1YLoaDTVvsQh4a3XCePYcoVep4 sP7w== X-Gm-Message-State: APzg51CpFR0jsnFGLbSo+UL4jZcBj+4xXZ3NhQC+dEfs2iANKjosjiv8 /lDR52yh25ER7tqIXx2DiR8qzw== X-Received: by 2002:a17:902:b283:: with SMTP id u3-v6mr25493239plr.2.1537209262573; Mon, 17 Sep 2018 11:34:22 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:22 -0700 (PDT) From: Baolin Wang To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, broonie@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] serial: sprd: Remove unused structure Date: Mon, 17 Sep 2018 11:33:40 -0700 Message-Id: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Remove the unused reg_backup structure. Signed-off-by: Baolin Wang Acked-by: Chunyan Zhang --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 11 ----------- 1 file changed, 11 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 828f114..1b0e3fb 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -95,19 +95,8 @@ #define SPRD_IMSR_BREAK_DETECT BIT(7) #define SPRD_IMSR_TIMEOUT BIT(13) -struct reg_backup { - u32 ien; - u32 ctrl0; - u32 ctrl1; - u32 ctrl2; - u32 clkd0; - u32 clkd1; - u32 dspwait; -}; - struct sprd_uart_port { struct uart_port port; - struct reg_backup reg_bak; char name[16]; }; From patchwork Mon Sep 17 18:33:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146856 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099745ljw; Mon, 17 Sep 2018 11:34:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZzLiva7UdAuGNJPtExBPH6dbKOve31jdFGVLfabx9DdQ0y7Dw4PAkoj9idLdtjJTItld37 X-Received: by 2002:a63:7c50:: with SMTP id l16-v6mr24518738pgn.311.1537209268665; Mon, 17 Sep 2018 11:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209268; cv=none; d=google.com; s=arc-20160816; b=W/7JaHTtCEPN7LumfhG1wUjgK6cmsdG2UYfGApWexR3ygew7i+deGijoBXoefYqmMD rLlDQIVXuymbHb+RPWt/oNiQM/YRod5S31HBoiwZSNREzpdCR4JmI0Ma9yB0uBb4TwwF lzYDvr0VlTOlydyL/qWSlPFEXQd8CYDu9MprvClxj0uay5CAPrHwpbCZpqGrS4QykCoz V9oozoNsTwD5NzI6qLTaSPWx8KB6aLi7Q3h8G9tNcjk9kKVPFwEXkbZIqI6VR5N7pgRz nMK3HZCyPwQ23Dp9LSruTwvhpZ9e+HsHydbveMkoJ1Rd7enFjA4YDQDg6tqCmPI8Bjd4 Vikg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=WH/Vo+B5WWaXNT9DiHeHYFHFiKjXCZtOJhhCxXmf7tE=; b=FYjSBcNZLNS2jZNVxDtlfUb9LODuHjNlP3omimQIP5P/gBzoKKPxkfj5afj9Smjfne 9oTMc0pF2alT/e/QjIeBDxV9lzOenATkYXTObzLr1M4Wb/N8Xz74H4sHBysz9na4V2C7 BUi7MOV+kljJBiv4tD0XpTOHpcWdrCCUg0Bgv1+MyaXYyuUohNnQFLjjHLl5g5xtGnkV zJZ5UPIN4CAqL0Y6HTWaniW+bOdmnurCuFw6LpouVsvUBANEC4B5c3eYUBoEG4nZiqdk 5ZnQkMZBLVCLdyK+pI4GSgcNSuilp64VZGmzjlT9ZdVX0lRo3faetGimZ79qhNMxjk1q sP/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoJ07IO9; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si16186779pgb.226.2018.09.17.11.34.28; Mon, 17 Sep 2018 11:34:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OoJ07IO9; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbeIRAC7 (ORCPT + 2 others); Mon, 17 Sep 2018 20:02:59 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40932 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbeIRAC7 (ORCPT ); Mon, 17 Sep 2018 20:02:59 -0400 Received: by mail-pf1-f194.google.com with SMTP id s13-v6so7958420pfi.7 for ; Mon, 17 Sep 2018 11:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=WH/Vo+B5WWaXNT9DiHeHYFHFiKjXCZtOJhhCxXmf7tE=; b=OoJ07IO9TflZX+amoiaCwH5GUCzM+VUSdTISOZYFXA+UvZcKFxoqhg+3t/xl7p/x1b Cc4jB06DtSs0a5Z+HnMPeeuvYFJPBHuOMQybmm1NPxdKAx7dTVNHYgK+46VqRE34QS9x SAIClrN4zZNg+97hDG/xxbQg31CcU8aluaCbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=WH/Vo+B5WWaXNT9DiHeHYFHFiKjXCZtOJhhCxXmf7tE=; b=juFTQOxy0EnDZyZBjRjBYMultmWuupALw6Q4jBTf1Fra1dP1v3IewjK60gituynbRO /N21Uy0pZdhXxaNmUAo6V6KjrQo83fLJh8VOs+lhGJyeqJNQw/jWKnE+DSUlh+Gm2KRQ fMRNvIlKuhJ1o4faF5imGmhebAOyzxtIbCwO6xwYDlkz2BtkqiKzlMESuMW99hzAB6bS KqhrZ61x+gpL4B5G/z1JK6Yy/BVwmqlVrtjjP86g7ICK3qDsuq1cCQJdsgDx8+G3/Wcf 2MmVo4ZIbdrmKSeVy7uN6nc4CrD93KMk7q3I5OvFceegsB85IU4s8zrey0wpSvvlGKiT gcFQ== X-Gm-Message-State: APzg51DGUDIIbbIc+tk2dWPuaVYnBTZtO1EzmInFlaeKzg6ePrehzQe7 OrQp6qrsNy0Nd7rVX+F8PZGyAQ== X-Received: by 2002:a63:6a06:: with SMTP id f6-v6mr24537943pgc.63.1537209266132; Mon, 17 Sep 2018 11:34:26 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:25 -0700 (PDT) From: Baolin Wang To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, broonie@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] serial: sprd: Use readable macros instead of magic number Date: Mon, 17 Sep 2018 11:33:41 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Define readable macros instead of magic number to make code more readable. Signed-off-by: Baolin Wang Acked-by: Chunyan Zhang --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 1b0e3fb..e18d8af 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -45,6 +45,8 @@ /* data number in TX and RX fifo */ #define SPRD_STS1 0x000C +#define SPRD_RX_FIFO_CNT_MASK GENMASK(7, 0) +#define SPRD_TX_FIFO_CNT_MASK GENMASK(15, 8) /* interrupt enable register and its BITs */ #define SPRD_IEN 0x0010 @@ -82,11 +84,15 @@ /* fifo threshold register */ #define SPRD_CTL2 0x0020 #define THLD_TX_EMPTY 0x40 +#define THLD_TX_EMPTY_SHIFT 8 #define THLD_RX_FULL 0x40 /* config baud rate register */ #define SPRD_CLKD0 0x0024 +#define SPRD_CLKD0_MASK GENMASK(15, 0) #define SPRD_CLKD1 0x0028 +#define SPRD_CLKD1_MASK GENMASK(20, 16) +#define SPRD_CLKD1_SHIFT 16 /* interrupt mask status register */ #define SPRD_IMSR 0x002C @@ -115,7 +121,7 @@ static inline void serial_out(struct uart_port *port, int offset, int value) static unsigned int sprd_tx_empty(struct uart_port *port) { - if (serial_in(port, SPRD_STS1) & 0xff00) + if (serial_in(port, SPRD_STS1) & SPRD_TX_FIFO_CNT_MASK) return 0; else return TIOCSER_TEMT; @@ -213,7 +219,8 @@ static inline void sprd_rx(struct uart_port *port) struct tty_port *tty = &port->state->port; unsigned int ch, flag, lsr, max_count = SPRD_TIMEOUT; - while ((serial_in(port, SPRD_STS1) & 0x00ff) && max_count--) { + while ((serial_in(port, SPRD_STS1) & SPRD_RX_FIFO_CNT_MASK) && + max_count--) { lsr = serial_in(port, SPRD_LSR); ch = serial_in(port, SPRD_RXD); flag = TTY_NORMAL; @@ -303,16 +310,17 @@ static int sprd_startup(struct uart_port *port) struct sprd_uart_port *sp; unsigned long flags; - serial_out(port, SPRD_CTL2, ((THLD_TX_EMPTY << 8) | THLD_RX_FULL)); + serial_out(port, SPRD_CTL2, + THLD_TX_EMPTY << THLD_TX_EMPTY_SHIFT | THLD_RX_FULL); /* clear rx fifo */ timeout = SPRD_TIMEOUT; - while (timeout-- && serial_in(port, SPRD_STS1) & 0x00ff) + while (timeout-- && serial_in(port, SPRD_STS1) & SPRD_RX_FIFO_CNT_MASK) serial_in(port, SPRD_RXD); /* clear tx fifo */ timeout = SPRD_TIMEOUT; - while (timeout-- && serial_in(port, SPRD_STS1) & 0xff00) + while (timeout-- && serial_in(port, SPRD_STS1) & SPRD_TX_FIFO_CNT_MASK) cpu_relax(); /* clear interrupt */ @@ -433,10 +441,11 @@ static void sprd_set_termios(struct uart_port *port, } /* clock divider bit0~bit15 */ - serial_out(port, SPRD_CLKD0, quot & 0xffff); + serial_out(port, SPRD_CLKD0, quot & SPRD_CLKD0_MASK); /* clock divider bit16~bit20 */ - serial_out(port, SPRD_CLKD1, (quot & 0x1f0000) >> 16); + serial_out(port, SPRD_CLKD1, + (quot & SPRD_CLKD1_MASK) >> SPRD_CLKD1_SHIFT); serial_out(port, SPRD_LCR, lcr); fc |= RX_TOUT_THLD_DEF | RX_HFC_THLD_DEF; serial_out(port, SPRD_CTL1, fc); @@ -510,7 +519,7 @@ static void wait_for_xmitr(struct uart_port *port) if (--tmout == 0) break; udelay(1); - } while (status & 0xff00); + } while (status & SPRD_TX_FIFO_CNT_MASK); } static void sprd_console_putchar(struct uart_port *port, int ch) From patchwork Mon Sep 17 18:33:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146857 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099799ljw; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdboFrKV59xUFCgXuTMuJpoHwwiwlzGu7A2kQZPTLWlDUHOEIby2GTsDkbGeg6aF9/0xIciX X-Received: by 2002:a63:d70e:: with SMTP id d14-v6mr24916118pgg.110.1537209271668; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209271; cv=none; d=google.com; s=arc-20160816; b=DNmg0Kz4h/+ZzIl2MrAJmsoALff4irzrix+mvmtE0TqthsFyk/7tRMmfJBbprtpFAz 0OvLWAJoSV3IaA/d3uhdi5n0jGRNEsX3Q80jWYsiuBXHLjw5EQ1NLCAehobNuxi4y2gq 25DvuTqTGGqSxW9G8NnzSCoCdNGotMU6RlG8BLSacamvGpHqLXBPYs73ZB3rEfa0KCAc C7apwpa5GpECj55Wp4l6xFcwr6u0n1llU8yE1ogq90vMDMpm52QgwQXtqDyQKrqvtqfr N7rXT9BFat+ML53P2dZj4EVdGnd586esr7jCDBbz3pS6qVE+lluKlo342NhxOAb1PiTA CAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=RCMO0ci1YKDq60thpl+IGNsY0BjRMDN5ZSXaR4D+wxNF5+GWpxvmt9jKNkfeFy+UrO Q24/UBHJlKR85nohSdqhian+X67g6a8zYwLJ5nWLEEef8Ez7zWZKOEaOg5htd8alb19I Mpd5MqP66ZwY7xFlK8Rhf0O3i0nHfagLpatj6oWq3R8GAFohhAF8vO5ZC/FUqlHE/EBu 36neByge2N1+UPNSFBmQvjFRjFZVCUzrhGCHadP3pdya6GERGY1LjIMJXomRgeCo8mUf Jh9AU2acknXwOyKU7DqG3FMUDFU3QlJvfdoxH32+dYz1Q3UZEoyMOFs/MU3uFiw73oJk V5Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CIoaKfN2; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64-v6si16750348pfb.314.2018.09.17.11.34.31; Mon, 17 Sep 2018 11:34:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CIoaKfN2; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbeIRADD (ORCPT + 2 others); Mon, 17 Sep 2018 20:03:03 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44329 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbeIRADD (ORCPT ); Mon, 17 Sep 2018 20:03:03 -0400 Received: by mail-pf1-f194.google.com with SMTP id k21-v6so7953204pff.11 for ; Mon, 17 Sep 2018 11:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=CIoaKfN2eySOLQs0TGAuKs75AahlejX/lyY3GO2XfIkfbPpz+exypfcOSnjJSLm3W+ n92b4ZTqsgyx5wO8XvdNLTdlm1K1q4OFWcoZ1+6XzAgpk+VNPMyiwpTpQ+h89u0dXrMC D5wYQfJ/hLhY+f1YcwDLLryTSTY618RFzlTJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ltLNIPFLQyeoJzz76sivioQ9yctXRHCKZQ+WN0q2SaM=; b=bMA5T79QkpIeZEKcQgzVztgTwSBIn/Ezkhxdq24M+3o+utje2ewzfOzuqjy1+ulX7D Rz88z9EtiIl+5xigY0d8eM/UhfK0s1HYW10+eJYgRmGurJpACmN9sS6xfyCY7I/c0LfN jRbuX3hZkxXgtjHX/zWx2ikLpY6dk+BA76OssXcAfQceX895YuJ8RnFiGfIlsrBDy/0s hFZSlCtnq+T8ywdKdq2LtckF6tLWeAnJA/xb7B3aveb7wFLMoCxWg6vaXx6D+Cjx3o+Y 8orLhha3vBJpbm3+gUG37ScJRMl0KN6wCbaoTFUeFtpCUGXN4y+qpHQTXJwS1XV7ZBUZ Obrg== X-Gm-Message-State: APzg51CxB/G36OCr76rJNmNhhIWw8gfg7AoUWuWzmXhWFgHK+aXfRIay WcqkBf4fJvSFkL4vzujA1wwiDA== X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr24167193pgs.203.1537209269843; Mon, 17 Sep 2018 11:34:29 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:29 -0700 (PDT) From: Baolin Wang To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, broonie@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] serial: sprd: Remove unnecessary resource validation Date: Mon, 17 Sep 2018 11:33:42 -0700 Message-Id: <8aa7a92468beb45348bf113696deb263c3f27792.1537208449.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The devm_ioremap_resource() will valid the resources, thus remove the unnecessary resource validation in the driver. Signed-off-by: Baolin Wang Acked-by: Chunyan Zhang --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index e18d8af..03b0cd4 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -710,15 +710,12 @@ static int sprd_probe(struct platform_device *pdev) up->uartclk = clk_get_rate(clk); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "not provide mem resource\n"); - return -ENODEV; - } - up->mapbase = res->start; up->membase = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(up->membase)) return PTR_ERR(up->membase); + up->mapbase = res->start; + irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "not provide irq resource: %d\n", irq); From patchwork Mon Sep 17 18:33:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146858 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099864ljw; Mon, 17 Sep 2018 11:34:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZdyyl2Lg24kqD1k04qfvZpq7TUN9nYeaQjPnSPCFHdezYznPnEVbFgNpGjzBcjMxUaiPE2 X-Received: by 2002:a17:902:9a06:: with SMTP id v6-v6mr26129057plp.316.1537209276202; Mon, 17 Sep 2018 11:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209276; cv=none; d=google.com; s=arc-20160816; b=aZKvbZcZ33JjA/3Y+D+lCwT44VUVy8u4J+ChyXZq6P5ICx9xuhL4xgSenJt6Kkxl3M 4t+xkxkUZro18Fwp/SSbvblh5J1YbdX3KvBWx1aDnCxbf0e/111WqkaYptYj1fKMXDX9 NxWUpToaBYRu3kEi+3qg1DTrgzvVPGW82C/m65LQBQo0YxtlwEpd1iEVoAsINxbBjHck W65TbTquiDj2UX+VSnHo6+v0C3OWEDhBdASLVtd0YH1kb6rbswlrQj325plncO9zzY/B ZfktSWaMm91c9tvN92Ah8fU+mPCCX8x0oU0km9H91Ldgi0yjRGIn6rUb1JQp+RlFV5OH fEUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=B0zBpssfvxrtSCSyQbtyOm38bQlWUmZUf/lgu2ZUuu8=; b=xafUOTs//6bBxiUUioqXhUS7nywUvDpf1eisHU3RSMK6JzYZ3cAh+QoRtdHPiAn2sb 68yDr4DvskifskuWHMru5RYXm+jOXYxFFrKZcySOgD1HSjvd7vNACmdgCj4XLYcAOXVU K4VU4+lxk2pHyXiGl1OxWpZplrV9KYYRSIbZkifCYZIXM1K0j4oKsL3vsMsVIwPzAKb5 iiMd6ozfv/B7zfy3PQKxMUuYGd2rmgzBIJSxWGYqey5Kn70YS+FY8D1hQDlbo2poSTVT DjZqmPxS00xErJz/4gl6z0cQZFKwuFC5gStqVC1e8LUKUlBfUb7vQM29N2VccJNGX5O0 11IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gydhJQmQ; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si16221777pgg.315.2018.09.17.11.34.36; Mon, 17 Sep 2018 11:34:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gydhJQmQ; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbeIRADH (ORCPT + 2 others); Mon, 17 Sep 2018 20:03:07 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39724 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728382AbeIRADG (ORCPT ); Mon, 17 Sep 2018 20:03:06 -0400 Received: by mail-pg1-f196.google.com with SMTP id i190-v6so8075483pgc.6 for ; Mon, 17 Sep 2018 11:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=B0zBpssfvxrtSCSyQbtyOm38bQlWUmZUf/lgu2ZUuu8=; b=gydhJQmQB9w8ls3zQWkNha1rmmvVTOnARsOVMj4ZvhJhMzm9Xe/ArVavuZd74PwTxn Tm+dcT/GYyJlf8SzmUoXuHTBtkcLZrf8X5hTIbucDMWR5qhbRxAJd8YHWLBa3qt94Fpo RYC8jIw7x/VCC9WtLCVKC7n3Z3IXqSkbyO948= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=B0zBpssfvxrtSCSyQbtyOm38bQlWUmZUf/lgu2ZUuu8=; b=fkTKzPszZc/jggU5JRPFM1zyr+AUAC8UsePZWyDPv7ezQEFj1UmAIEO2UhcPr9y/Jh hNDK92thXr4cgIJAFS5JSCewII/5DJvhdtHnl00peUnC/5qEC0uzJ7x8mjhQLZodhoiZ b0One/xdazlfkQ33i2c3d2nv1zqq7T4CG9YenBB6EtRrS67R0A9c8z6jG/jsjt81CFnt fzO6RbMJ0JYVVe6b2/4R3+Tx95oaPT99rP2esrTslOBARFjAETRlE5eqmja2icxWt0hb LWy4KO10KCcq47Oj6EWMwXCXue3mr+euUgUhP03bcC0NZggwd5TJdQYS7YH43r89buaT X20g== X-Gm-Message-State: APzg51BIZLRrjjDroBVQDqx3CVWAsAfem2gRrF+Vm9SXIqQ5qECyZEOz dV4skStUnfK6ZRhWwa0ykE6wbQ== X-Received: by 2002:a62:47d1:: with SMTP id p78-v6mr27118912pfi.197.1537209273296; Mon, 17 Sep 2018 11:34:33 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:32 -0700 (PDT) From: Baolin Wang To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, broonie@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] serial: sprd: Change 'int' to 'unsigned int' Date: Mon, 17 Sep 2018 11:33:43 -0700 Message-Id: <7167a2917e6469e7d7a04fa4558f3486b8294722.1537208449.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The register offset value should be 'unsigned int' type. Moreover, prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Baolin Wang Acked-by: Chunyan Zhang --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 03b0cd4..8d5c9cd 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -109,12 +109,14 @@ struct sprd_uart_port { static struct sprd_uart_port *sprd_port[UART_NR_MAX]; static int sprd_ports_num; -static inline unsigned int serial_in(struct uart_port *port, int offset) +static inline unsigned int serial_in(struct uart_port *port, + unsigned int offset) { return readl_relaxed(port->membase + offset); } -static inline void serial_out(struct uart_port *port, int offset, int value) +static inline void serial_out(struct uart_port *port, unsigned int offset, + int value) { writel_relaxed(value, port->membase + offset); } @@ -598,8 +600,7 @@ static void sprd_putc(struct uart_port *port, int c) writeb(c, port->membase + SPRD_TXD); } -static void sprd_early_write(struct console *con, const char *s, - unsigned n) +static void sprd_early_write(struct console *con, const char *s, unsigned int n) { struct earlycon_device *dev = con->data; From patchwork Mon Sep 17 18:33:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 146859 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4099918ljw; Mon, 17 Sep 2018 11:34:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZT/LZwaFPVkPI801XB8zSj4qxiguHssFfMkwc7cyC4u8PcQnBcVH1WRsjVEw4GReVXtdJN X-Received: by 2002:a17:902:74c8:: with SMTP id f8-v6mr10609371plt.95.1537209279195; Mon, 17 Sep 2018 11:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209279; cv=none; d=google.com; s=arc-20160816; b=tYkANtDMgMKc1jAoT5tfyou+UTGIXbL2q0EwOPAWb9nADvlEi6T5SWaKlWWfOs1rJv 1S2QP/P31WgKYrJrbB2J+7oiuWrGPqr0ywdXBMkejHmqYnmXKpPAP0aDcEgCo1iNEU4J e8DeO1nx/s1wArw8RS22K56UXzgI0rJwAd9o5wEuDDr9qfFyx9CwHVqmEXd0WHSo73Zq RNkAfI5sf2cHwPPZ9oMwnLh+nBbhi2q0LU7dZLig3P9GdIFDqYd1j44XdjQ3ShxqhQVF w9FUxX37WGKXfS/+CvE59D1Etv2AairLF52nZlm03DxPcI25zOVQGA5cLzhvCBufJe10 mT/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=J/vusGba74ICjFHPdDPM4Bpl/VsNWGGNESpPLnHoQ/w=; b=DVrrN4jdLrLoTymaZdYAkq1YZmJKNnUdptvhD+IlbHZQ1GmIJceBfK1uDSSzSi0Qlk HTPKOtc0tc12Y5bhkjukXFM2srEzzOM9W6mRw3uh+WI+lsHAjili4i70EzVQo/uLlUw5 oCudQ7eFsCj2NauzqXgMcoO+UsHkjVDRATRGGBr5TAW+Z8jKaKfasXjJZBmBVsUXVCNW F6gTQsDz234Gv+WPHUxykSL10N+6eel62tt7Sxwg/R6iFtqcEpRHKzptU6GiKz2tUKow 8RapqJpBs8WMAOmwy4Z6mOdUFksAq18JPjKr+Vr2USuPUspwrC6lJYyvRy3c/hfcqjiS HUBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXPCFtgo; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb4-v6si15734436plb.467.2018.09.17.11.34.38; Mon, 17 Sep 2018 11:34:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXPCFtgo; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728469AbeIRADK (ORCPT + 2 others); Mon, 17 Sep 2018 20:03:10 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41925 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728466AbeIRADK (ORCPT ); Mon, 17 Sep 2018 20:03:10 -0400 Received: by mail-pg1-f196.google.com with SMTP id s15-v6so8067872pgv.8 for ; Mon, 17 Sep 2018 11:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=J/vusGba74ICjFHPdDPM4Bpl/VsNWGGNESpPLnHoQ/w=; b=ZXPCFtgoyBNS1eJD4LmwrNO5//mKpxFWKmNXO689APLn75mngiUHEzYzJG8RqLcLq5 zsC6w9QtDD5/qvg1oRTv4E3k1Up0ZdHQiPmuLVhChoIs69orvenDX5CXJnSdJ+nMjaZG LMVVJ1MEE6DqYTdQoV2zg+AxLa+KswhaZfAkk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=J/vusGba74ICjFHPdDPM4Bpl/VsNWGGNESpPLnHoQ/w=; b=UpU5f03FIGDmC8kvmtaT4kWdku3OpQbVzlTvAbgLzWuaG6uY76FBHeQYoB6YNGt/yQ dG12CPlh8Lp9bxSSbpF5LfetIRn3yk5aaioarTTlnFoYJ1oN5J1i3xwoa43y6m245cRr T8ga3xM+XRHFBl6lJWuin/L8QO3C57jV2RPQvUvpS3Pls65UO/heHfldNSHtrBWYliAy c5Gf1KTu9w0mBmp6EvgzGFt9TbItOunNe0up5HzMJGEyCdvSNKMJYOp5rk+d+swu/N/C DOOuxOlY4hviRAwitSyoytcdOX6KF2wk6kZ93r5xN5x+K2NNJXkbD1ywL7kLqyHZILZ9 2Psg== X-Gm-Message-State: APzg51Bt93BspT/N9VE+jzQncyeQ0ebx3Ze6cwLspPvlQTJSBfIPsJ7Q pjC0Eq9de0Mng0NDeAn9WHXMrA== X-Received: by 2002:a63:c245:: with SMTP id l5-v6mr24602920pgg.255.1537209277024; Mon, 17 Sep 2018 11:34:37 -0700 (PDT) Received: from ubuntu.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id i7-v6sm17544137pgs.17.2018.09.17.11.34.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 11:34:36 -0700 (PDT) From: Baolin Wang To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, broonie@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] serial: sprd: Fix the indentation issue Date: Mon, 17 Sep 2018 11:33:44 -0700 Message-Id: <159889c1b417abcd9dc6eeffbecd0068b5b4ab2a.1537208449.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> In-Reply-To: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> References: <96e34fdadaf3f354f5d8e0d2895508e7c7918839.1537208449.git.baolin.wang@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Make the macros' definition and code have the same correct indentation. Signed-off-by: Baolin Wang Acked-by: Chunyan Zhang --- Changes from v1: - Add acked tag from Chunyan. --- drivers/tty/serial/sprd_serial.c | 46 +++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 24 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 8d5c9cd..4287ca3 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -68,24 +68,24 @@ #define SPRD_LCR_DATA_LEN6 0x4 #define SPRD_LCR_DATA_LEN7 0x8 #define SPRD_LCR_DATA_LEN8 0xc -#define SPRD_LCR_PARITY (BIT(0) | BIT(1)) +#define SPRD_LCR_PARITY (BIT(0) | BIT(1)) #define SPRD_LCR_PARITY_EN 0x2 #define SPRD_LCR_EVEN_PAR 0x0 #define SPRD_LCR_ODD_PAR 0x1 /* control register 1 */ -#define SPRD_CTL1 0x001C +#define SPRD_CTL1 0x001C #define RX_HW_FLOW_CTL_THLD BIT(6) #define RX_HW_FLOW_CTL_EN BIT(7) #define TX_HW_FLOW_CTL_EN BIT(8) #define RX_TOUT_THLD_DEF 0x3E00 -#define RX_HFC_THLD_DEF 0x40 +#define RX_HFC_THLD_DEF 0x40 /* fifo threshold register */ #define SPRD_CTL2 0x0020 -#define THLD_TX_EMPTY 0x40 +#define THLD_TX_EMPTY 0x40 #define THLD_TX_EMPTY_SHIFT 8 -#define THLD_RX_FULL 0x40 +#define THLD_RX_FULL 0x40 /* config baud rate register */ #define SPRD_CLKD0 0x0024 @@ -95,11 +95,11 @@ #define SPRD_CLKD1_SHIFT 16 /* interrupt mask status register */ -#define SPRD_IMSR 0x002C -#define SPRD_IMSR_RX_FIFO_FULL BIT(0) +#define SPRD_IMSR 0x002C +#define SPRD_IMSR_RX_FIFO_FULL BIT(0) #define SPRD_IMSR_TX_FIFO_EMPTY BIT(1) -#define SPRD_IMSR_BREAK_DETECT BIT(7) -#define SPRD_IMSR_TIMEOUT BIT(13) +#define SPRD_IMSR_BREAK_DETECT BIT(7) +#define SPRD_IMSR_TIMEOUT BIT(13) struct sprd_uart_port { struct uart_port port; @@ -229,7 +229,7 @@ static inline void sprd_rx(struct uart_port *port) port->icount.rx++; if (lsr & (SPRD_LSR_BI | SPRD_LSR_PE | - SPRD_LSR_FE | SPRD_LSR_OE)) + SPRD_LSR_FE | SPRD_LSR_OE)) if (handle_lsr_errors(port, &lsr, &flag)) continue; if (uart_handle_sysrq_char(port, ch)) @@ -292,8 +292,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) if (ims & SPRD_IMSR_TIMEOUT) serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT); - if (ims & (SPRD_IMSR_RX_FIFO_FULL | - SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT)) + if (ims & (SPRD_IMSR_RX_FIFO_FULL | SPRD_IMSR_BREAK_DETECT | + SPRD_IMSR_TIMEOUT)) sprd_rx(port); if (ims & SPRD_IMSR_TX_FIFO_EMPTY) @@ -333,7 +333,7 @@ static int sprd_startup(struct uart_port *port) sp = container_of(port, struct sprd_uart_port, port); snprintf(sp->name, sizeof(sp->name), "sprd_serial%d", port->line); ret = devm_request_irq(port->dev, port->irq, sprd_handle_irq, - IRQF_SHARED, sp->name, port); + IRQF_SHARED, sp->name, port); if (ret) { dev_err(port->dev, "fail to request serial irq %d, ret=%d\n", port->irq, ret); @@ -361,8 +361,8 @@ static void sprd_shutdown(struct uart_port *port) } static void sprd_set_termios(struct uart_port *port, - struct ktermios *termios, - struct ktermios *old) + struct ktermios *termios, + struct ktermios *old) { unsigned int baud, quot; unsigned int lcr = 0, fc; @@ -480,8 +480,7 @@ static void sprd_config_port(struct uart_port *port, int flags) port->type = PORT_SPRD; } -static int sprd_verify_port(struct uart_port *port, - struct serial_struct *ser) +static int sprd_verify_port(struct uart_port *port, struct serial_struct *ser) { if (ser->type != PORT_SPRD) return -EINVAL; @@ -531,7 +530,7 @@ static void sprd_console_putchar(struct uart_port *port, int ch) } static void sprd_console_write(struct console *co, const char *s, - unsigned int count) + unsigned int count) { struct uart_port *port = &sprd_port[co->index]->port; int locked = 1; @@ -594,7 +593,7 @@ static void sprd_putc(struct uart_port *port, int c) unsigned int timeout = SPRD_TIMEOUT; while (timeout-- && - !(readl(port->membase + SPRD_LSR) & SPRD_LSR_TX_OVER)) + !(readl(port->membase + SPRD_LSR) & SPRD_LSR_TX_OVER)) cpu_relax(); writeb(c, port->membase + SPRD_TXD); @@ -607,9 +606,8 @@ static void sprd_early_write(struct console *con, const char *s, unsigned int n) uart_console_write(&dev->port, s, n, sprd_putc); } -static int __init sprd_early_console_setup( - struct earlycon_device *device, - const char *opt) +static int __init sprd_early_console_setup(struct earlycon_device *device, + const char *opt) { if (!device->port.membase) return -ENODEV; @@ -691,8 +689,8 @@ static int sprd_probe(struct platform_device *pdev) index = sprd_probe_dt_alias(index, &pdev->dev); - sprd_port[index] = devm_kzalloc(&pdev->dev, - sizeof(*sprd_port[index]), GFP_KERNEL); + sprd_port[index] = devm_kzalloc(&pdev->dev, sizeof(*sprd_port[index]), + GFP_KERNEL); if (!sprd_port[index]) return -ENOMEM;