Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3206068pxk; Mon, 21 Sep 2020 07:52:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZsXArfYRzd9iZl1h3H7lHj4lqE1mOxX1m8zU84askTS5iPTREvnc44CvA4BiCMeBTiyMG X-Received: by 2002:a50:ab1d:: with SMTP id s29mr32325edc.246.1600699924468; Mon, 21 Sep 2020 07:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699924; cv=none; d=google.com; s=arc-20160816; b=dFP8zA9KXJ+UsVM/Wip/giaPJcvJQ9YWwtn6sPo3VuB4qPofEurfhbrN+UxHhpgZqE GmdyALkprFi3JPNnIrCB3pXc5dqBd8FLrY3XkFEaUx7ShXxE+cLomMMv6UgSfgQxtrC0 OkxsLpYMXITAEoBZjraox8qDGBj/5L8we327LRZAURqiBQEoyoeM8h1+qAv+6ZmBz3bn dRbBnaHSPykqmfzOtATU/n6kKjiG1tLwT3Xvxj8FglpwtdgcFIoHcnxIMewJSzP+rUFz zm23fPfnAgHIp15G9gF7hl9z6OAYpkateQKq7xOPuNnbwfuT4kafBSGElMUuAaenhzPU Rnaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9UVx7FqPt79p6HFiHgfZrmhKmi4r7PtDl8yLW70qrS0=; b=TpNDiXB0i7zAJ8CA/yOFyXr1pIWXKGYvjcBrTDReC/hQ+1zjXd8QaWFZoRmOzcSSAf XkguBtMWZ6DuFTCHc1pOmnxvDIx2wcZB/brET9iBleqB/KwNIDHily8jhYTdms8uMKtn Ltk/86FHxble6lzDm9TZRISRXHhmv5z0j6nHdP69bBTbKKXtJSTBbvQQxZzp84MS1BXp V1HKyydIQi3gU5E0oaeAwbAxosZnGYh7C10dEvH6if0TtkGHr5oui0zHlk236QovRo+r d5vplcgPCCf72Jj4e0uKBaPIsq50YKWG4GdYoK44Q2Byf5UvEXzKXb4XuRJ2brosGReI QX/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si5892248ejw.413.2020.09.21.07.51.41; Mon, 21 Sep 2020 07:52:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbgIUOss (ORCPT + 99 others); Mon, 21 Sep 2020 10:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728078AbgIUOsN (ORCPT ); Mon, 21 Sep 2020 10:48:13 -0400 Received: from smtp1.goneo.de (smtp1.goneo.de [IPv6:2001:1640:5::8:30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 849A9C0613D8 for ; Mon, 21 Sep 2020 07:48:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id 6A94D23F153; Mon, 21 Sep 2020 16:48:12 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.994 X-Spam-Level: X-Spam-Status: No, score=-2.994 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.094, BAYES_00=-1.9] autolearn=ham Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mW4g9Szo3Fb1; Mon, 21 Sep 2020 16:48:10 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp1.goneo.de (Postfix) with ESMTPA id D25E623F1E5; Mon, 21 Sep 2020 16:48:09 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel Subject: [PATCH v2 29/32] auxdisplay: charlcd: replace last device specific stuff Date: Mon, 21 Sep 2020 16:46:41 +0200 Message-Id: <20200921144645.2061313-30-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921144645.2061313-1-poeschel@lemonage.de> References: <20191016082430.5955-1-poeschel@lemonage.de> <20200921144645.2061313-1-poeschel@lemonage.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel These are the last bits left in charlcd.c that are device specific and they are removed now. In detail this is: * bwidth, which is the width of the display buffer per line. This is replaced by width of the display. * hwidth, which is the size of the display buffer as a whole. This is replaced by looping all chars of a line by all lines. * the hd44780_common header include can go away. Signed-off-by: Lars Poeschel --- drivers/auxdisplay/charlcd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 0137e741c5bb..78a61c3f1eb0 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -20,7 +20,6 @@ #include #include "charlcd.h" -#include "hd44780_common.h" /* Keep the backlight on this many seconds for each flash */ #define LCD_BL_TEMPO_PERIOD 4 @@ -112,8 +111,6 @@ static void charlcd_home(struct charlcd *lcd) static void charlcd_print(struct charlcd *lcd, char c) { - struct hd44780_common *hdc = lcd->drvdata; - if (lcd->char_conv) c = lcd->char_conv[(unsigned char)c]; @@ -121,7 +118,7 @@ static void charlcd_print(struct charlcd *lcd, char c) lcd->addr.x++; /* prevents the cursor from wrapping onto the next line */ - if (lcd->addr.x == hdc->bwidth) + if (lcd->addr.x == lcd->width) lcd->ops->gotoxy(lcd); } @@ -199,7 +196,6 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y) static inline int handle_lcd_special_code(struct charlcd *lcd) { struct charlcd_priv *priv = charlcd_to_priv(lcd); - struct hd44780_common *hdc = lcd->drvdata; /* LCD special codes */ @@ -327,7 +323,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) xs = lcd->addr.x; ys = lcd->addr.y; - for (x = lcd->addr.x; x < hdc->bwidth; x++) + for (x = lcd->addr.x; x < lcd->width; x++) lcd->ops->print(lcd, ' '); /* restore cursor position */ @@ -370,7 +366,6 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) static void charlcd_write_char(struct charlcd *lcd, char c) { struct charlcd_priv *priv = charlcd_to_priv(lcd); - struct hd44780_common *hdc = lcd->drvdata; /* first, we'll test if we're in escape mode */ if ((c != '\n') && priv->esc_seq.len >= 0) { @@ -411,7 +406,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) * flush the remainder of the current line and * go to the beginning of the next line */ - for (; lcd->addr.x < hdc->bwidth; lcd->addr.x++) + for (; lcd->addr.x < lcd->width; lcd->addr.x++) lcd->ops->print(lcd, ' '); lcd->addr.x = 0; -- 2.28.0