Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp301711pxx; Thu, 29 Oct 2020 03:03:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhAR6nR8BdATZg29APWFCYkY1BRZiYj6U1K6/f3z7ApRHQcRfKoX2GijieIUdERpRGhOGI X-Received: by 2002:a05:6402:1148:: with SMTP id g8mr3203717edw.271.1603965815152; Thu, 29 Oct 2020 03:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603965815; cv=none; d=google.com; s=arc-20160816; b=NIdomJbDsgz3Z7t0tdHHANifzGbIuu4dCicGkTcjZ/+c/msYpVfMyevNn4ia21Obd3 OLR/m7SKqVclbZ0/17jGb6mw4E+nwT+ixPFFwJHWSp+OS38UbskwdXLZakVSTIFPYsaa boAOCJ3Vtu/u92H61rJWoQiluLBI3+fzDwTU12JE7q/sRwTS4KcF0NqNI2NakZwoBrNx 5UgCqE3oE7CjQKVNhhW/xASo6vZvyTrFe+O/sGsAJqHBHlWOIUAJHA2/tUQnA1BGYGaZ HV6HLKLfuJ56hguGVyT0kXDxtmKrVigdHxfBygDwX/J/c/pg5yiMGcp2dcreoe8bmwb/ Ex8A== 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=d9RFMndRIwFPNy1SOQAR2xAkiUL4s63wmAh6r4gj0c8=; b=ALTYQOqYEgicexm49KYThC35c+yIxofY7J2GlvVva/MDIrLsky1gE3PUhXEkgfEqKE BRRFtiPKs01KUAyu/U+Z/JRl5MAEm+QPyePd5QBNljcLupQG2qwbMotnkaLLKQ3QyvXr ql9FinGddcdR7N++z1ov+1+DadNU+zL1bI1UIERTEPEmcr107Sdd00N7y4KqOCuxE5ZS i8zfVm2uDzdAPvfxiTyesUgkfuth/ekaC05TumZDwlKZK4nWnY9J/PAumOxBZbiV1Y8C pErqXkv+Eq4Mg7GV+su4UmoCwvcYdAkgCEzTLf6kCCkEcU2lGY9a2CpN67n2mDuCemFL 0uBA== 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 w5si1478396edi.590.2020.10.29.03.03.12; Thu, 29 Oct 2020 03:03:35 -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 S1727108AbgJ2J6O (ORCPT + 99 others); Thu, 29 Oct 2020 05:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgJ2J6L (ORCPT ); Thu, 29 Oct 2020 05:58:11 -0400 Received: from smtp3-1.goneo.de (smtp3.goneo.de [IPv6:2001:1640:5::8:37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEE80C0613DA for ; Thu, 29 Oct 2020 02:58:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.goneo.de (Postfix) with ESMTP id A5C6B23F5FF; Thu, 29 Oct 2020 10:58:08 +0100 (CET) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.946 X-Spam-Level: X-Spam-Status: No, score=-2.946 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.046, BAYES_00=-1.9] autolearn=ham Received: from smtp3.goneo.de ([127.0.0.1]) by localhost (smtp3.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GQTcRKiA8IzK; Thu, 29 Oct 2020 10:58:07 +0100 (CET) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp3.goneo.de (Postfix) with ESMTPA id 112CC2402CD; Thu, 29 Oct 2020 10:58:07 +0100 (CET) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel , Willy Tarreau Subject: [PATCH v5 21/25] auxdisplay: charlcd: replace last device specific stuff Date: Thu, 29 Oct 2020 10:57:25 +0100 Message-Id: <20201029095731.311528-20-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029095731.311528-1-poeschel@lemonage.de> References: <20201029095231.311083-1-poeschel@lemonage.de> <20201029095731.311528-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. Reviewed-by: Willy Tarreau 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 077c01e87127..59f21401d6a9 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); } @@ -195,7 +192,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 */ @@ -323,7 +319,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 */ @@ -366,7 +362,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) { @@ -407,7 +402,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