From nobody Thu Dec 18 08:28:05 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE3C426280C for ; Mon, 24 Feb 2025 17:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418225; cv=none; b=kLE+mE73CdObvezyIb+QtvhFMXbQB2RgpPtwgalkpTzBYJVnlu6MkgotQ3+cySd+bFRLylGyl/epJnV+eJr+OvTmXTiK4sGhA7xs+N0lno2HPyOdPJnUS0SdGjUdYWou2ABhW7yRIGwBuleFeaZ/3UNr+r8aumc+z5hBMmEx1Bs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418225; c=relaxed/simple; bh=Jo/jEPORP9FRu1+CGCAN4WHZILUMw23E9Hkh6SQ6GAw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PkNLjwI44FSp9QR0gB6u0eufd++/qojkO3GEptopOkZBRWiu0a2wtRylHONLW+g6qw7kAcO2iOiTKD1z4X95KUvBm7PoTWRFFDIRwgDZY+Wq6NkukH0CoAhhS4bAHJSJ4uyeuqxmw1K0JUWJGvl6Uqqh0j+rX2wrVvPsg4WiJr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=G01nFzkf; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G01nFzkf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418224; x=1771954224; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Jo/jEPORP9FRu1+CGCAN4WHZILUMw23E9Hkh6SQ6GAw=; b=G01nFzkfganpiFInFUCFBXu/IVFedAqtockEQZrzmo/qApmabE/+kqus GSQjm2nZs8HkeV7cCxmaAJrh5jtp9xgz2aFIIIV1dDxPTQvyzjgGHz0Nr 3rMByyXtFMqQRy0E3I+AaVLHrM2/eJrJd6uDCUqywI1C9EbozMvhJONnu +olMJv1k+C69Jfy9baYta+Wj68uzGkm5yXRT7V969dnSoQfis9fV4kUJ1 LBQ8SOzHfa3nsJ7SDyuDkAYrdj+06WiQhhjRN7UjANts4xVc2BS3uuxFy gzCvHiqgbpaN6NZGro1crtA6sCpd1Ai+ryZ6wlDNu6isYjFWako2wMSEF Q==; X-CSE-ConnectionGUID: j3z98rbCTj2TV4adf4C9fw== X-CSE-MsgGUID: lP3iRHkCQiO9vc1sdBCgZA== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="41307942" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="41307942" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:23 -0800 X-CSE-ConnectionGUID: DD1irL4zTWK4DPfuI5bslw== X-CSE-MsgGUID: VXUCcxLqSISgYO/QGnQMVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="117027888" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 24 Feb 2025 09:30:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DEF3B172; Mon, 24 Feb 2025 19:30:19 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 1/7] auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common" Date: Mon, 24 Feb 2025 19:27:38 +0200 Message-ID: <20250224173010.219024-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The commit 2545c1c948a6 ("auxdisplay: Move hwidth and bwidth to struct hd44780_common") makes charlcd_alloc() argument-less effectively dropping the single allocation for the struct charlcd_priv object along with the driver specific one. Restore that behaviour here. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/charlcd.c | 5 +++-- drivers/auxdisplay/charlcd.h | 5 +++-- drivers/auxdisplay/hd44780.c | 2 +- drivers/auxdisplay/lcd2s.c | 2 +- drivers/auxdisplay/panel.c | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 19b619376d48..09020bb8ad15 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -595,18 +595,19 @@ static int charlcd_init(struct charlcd *lcd) return 0; } =20 -struct charlcd *charlcd_alloc(void) +struct charlcd *charlcd_alloc(unsigned int drvdata_size) { struct charlcd_priv *priv; struct charlcd *lcd; =20 - priv =3D kzalloc(sizeof(*priv), GFP_KERNEL); + priv =3D kzalloc(sizeof(*priv) + drvdata_size, GFP_KERNEL); if (!priv) return NULL; =20 priv->esc_seq.len =3D -1; =20 lcd =3D &priv->lcd; + lcd->drvdata =3D priv->drvdata; =20 return lcd; } diff --git a/drivers/auxdisplay/charlcd.h b/drivers/auxdisplay/charlcd.h index 4d4287209d04..d10b89740bca 100644 --- a/drivers/auxdisplay/charlcd.h +++ b/drivers/auxdisplay/charlcd.h @@ -51,7 +51,7 @@ struct charlcd { unsigned long y; } addr; =20 - void *drvdata; + void *drvdata; /* Set by charlcd_alloc() */ }; =20 /** @@ -95,7 +95,8 @@ struct charlcd_ops { }; =20 void charlcd_backlight(struct charlcd *lcd, enum charlcd_onoff on); -struct charlcd *charlcd_alloc(void); + +struct charlcd *charlcd_alloc(unsigned int drvdata_size); void charlcd_free(struct charlcd *lcd); =20 int charlcd_register(struct charlcd *lcd); diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index 9d0ae9c02e9b..1d67fe324341 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -226,7 +226,7 @@ static int hd44780_probe(struct platform_device *pdev) if (!hdc) return -ENOMEM; =20 - lcd =3D charlcd_alloc(); + lcd =3D charlcd_alloc(0); if (!lcd) goto fail1; =20 diff --git a/drivers/auxdisplay/lcd2s.c b/drivers/auxdisplay/lcd2s.c index f831ce762508..d573d36e3067 100644 --- a/drivers/auxdisplay/lcd2s.c +++ b/drivers/auxdisplay/lcd2s.c @@ -310,7 +310,7 @@ static int lcd2s_i2c_probe(struct i2c_client *i2c) if (err < 0) return err; =20 - lcd =3D charlcd_alloc(); + lcd =3D charlcd_alloc(0); if (!lcd) return -ENOMEM; =20 diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 6dc8798d01f9..4da142692d55 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -835,7 +835,7 @@ static void lcd_init(void) if (!hdc) return; =20 - charlcd =3D charlcd_alloc(); + charlcd =3D charlcd_alloc(0); if (!charlcd) { kfree(hdc); return; --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:05 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A915264A88 for ; Mon, 24 Feb 2025 17:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418255; cv=none; b=hMGmfi04VONLNKEbKEGsUmMAwEeXaNsEu5E//8IOzivbx8SyNPjoiN1lyrY/FwWcEUq7Nc/xgIawDPmJqAcNtuzpFoZNhJOk7Y4/QVIwmwymIvYNfLq5DvouG7APXvYCw4+tDPVoRKD5tq3A8B1BaZZqtPT/BJtWEb8D7qsB0hI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418255; c=relaxed/simple; bh=VjWVgbSMDbC5Upj8LIuVG2O8EKByj2emxs/hZwqVhTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uMIG40f4he874rm31r37J/4b+wtFqPxTTWx1+C3j4DdBBgAmjWf7r+Fne8L11M7ZUH7WgTsKYVuLsy8G/gE+oaD8jgIiW9dYc7swPM1POflZflPCr21Uzz/365i3K+oQPfi6TGRKHbUDuJWo2FSzfTdcNLid7aPG0wAIYwyquKI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=f1Pj0sNy; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="f1Pj0sNy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418254; x=1771954254; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VjWVgbSMDbC5Upj8LIuVG2O8EKByj2emxs/hZwqVhTE=; b=f1Pj0sNyMEwN/I0ykmwkH0vDnXFp32Hc6lEdQEi7YeJ2U33x/nOyaje3 G+e/i7tgi6Nh1rmX4CaEp1VjS/JsTWyFwTns350x9AOl9C5i1cYc4IROx I9C+FIjeRe9hqvr28us9SN08VNz6fEciKyfB8q5Atuqyh1otwkNw+moFj T2tvpJIlQpiAXa+xKBVlhy/bYecCvbCH3EWlzq9zGmXyxRF2hCBOXI/f0 5IO7ESJtX1jNzHmHTe8DVTVN9ySYHmfuWYmg3HLvWhVa6JyGlSzP3hZbF PQ/WdyJncXhFxp6q2LtHS5yYa5LvLR2d6/apBjPtG6VuECGWQX3Gfot8A w==; X-CSE-ConnectionGUID: aUrdpYXgQBqyZq9kHRH8Qg== X-CSE-MsgGUID: hqdvkuiRQPa/o8dWHpOtGw== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="66555689" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="66555689" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:42 -0800 X-CSE-ConnectionGUID: iicq4B0LTPSTD7WHjfujsA== X-CSE-MsgGUID: L1K7vNYgRxCa1AJwD0qBfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="115875663" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 24 Feb 2025 09:30:21 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E6FF21D0; Mon, 24 Feb 2025 19:30:19 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 2/7] auxdisplay: lcd2s: Allocate memory for custom data in charlcd_alloc() Date: Mon, 24 Feb 2025 19:27:39 +0200 Message-ID: <20250224173010.219024-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allocate memory for custom data in charlcd_alloc() instead of doing that explicitly in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/lcd2s.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/auxdisplay/lcd2s.c b/drivers/auxdisplay/lcd2s.c index d573d36e3067..d18735665706 100644 --- a/drivers/auxdisplay/lcd2s.c +++ b/drivers/auxdisplay/lcd2s.c @@ -301,20 +301,18 @@ static int lcd2s_i2c_probe(struct i2c_client *i2c) I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) return -EIO; =20 - lcd2s =3D devm_kzalloc(&i2c->dev, sizeof(*lcd2s), GFP_KERNEL); - if (!lcd2s) - return -ENOMEM; - /* Test, if the display is responding */ err =3D lcd2s_i2c_smbus_write_byte(i2c, LCD2S_CMD_DISPLAY_OFF); if (err < 0) return err; =20 - lcd =3D charlcd_alloc(0); + lcd =3D charlcd_alloc(sizeof(*lcd2s)); if (!lcd) return -ENOMEM; =20 - lcd->drvdata =3D lcd2s; + lcd->ops =3D &lcd2s_ops; + + lcd2s =3D lcd->drvdata; lcd2s->i2c =3D i2c; lcd2s->charlcd =3D lcd; =20 @@ -329,8 +327,6 @@ static int lcd2s_i2c_probe(struct i2c_client *i2c) if (err) goto fail1; =20 - lcd->ops =3D &lcd2s_ops; - err =3D charlcd_register(lcd2s->charlcd); if (err) goto fail1; --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:05 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C3E8264A6E for ; Mon, 24 Feb 2025 17:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418250; cv=none; b=XzAYy31JAeZpzhKzgjv38F7EwXHIPF5Ai2OSUO8CwcMh6Hu6TQFdqB0CwV58mJDpMLZDyitrimUXq38i6kHPxXeeG6V5M3/27dzyUAiCSx9nJR//cSErwijE4iKtX9embvETHRn+nxPQS6kbhWMA+bK9r2lPYUYqYNuK+ZDdyqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418250; c=relaxed/simple; bh=7xUv+TO8IbMC37opWagll0H8eevWflJ9+aQI8RFk9ek=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jJsh77r99yNZmaSuN0HxDCzFTAzpFwhmFZMHP4DRKtX0IXSHdiS3vTGY0S1ACL6Dw49Pc/BiU55GXzdXzdYaPiTH0bekhRZMJn+TznfC7VhnEw0wNt0HsjmSCCL6BeNMj3PK17ToqiBt25Bvh6f3n/BIMCVQYtCmaCnIHz1LVAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LSeeF1cv; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LSeeF1cv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418250; x=1771954250; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7xUv+TO8IbMC37opWagll0H8eevWflJ9+aQI8RFk9ek=; b=LSeeF1cvV3vrsvZAyZ1BW3gXNjEta8r+peIsHE+3J9N8X2TnEDQTBL3/ pG5N4h0sLK61xP56yMPhQqksYcD+8nt7yOMb9YHaPWhvGjUBYLbLmp/gJ M8YiWqlB7i+vd6SDF8tqJ0D/hs7/fhyDu6sYYuVxcG2zBiQZiU2ahKEFL LhQbksDorexGk5H8jjXWy06BwbMPAEjk5Msfx9aF1bC6SNNi3B+wd+wd6 m9qvrvmbqMXOIFRP1USHX8gMgDO6Ua+EAnP5nc8tT7p+k2rvieWj5gFb6 BJFa36Jz4EngwBs3y8FHGwmvl/MiZgD+SJs4kAUY2eRKx5TweGEVWKc01 A==; X-CSE-ConnectionGUID: QXbQ8Q3GQv+IZ6P9ZUp7ig== X-CSE-MsgGUID: WNTbK9gNQLeaPxkP4RQMTg== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="66555681" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="66555681" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:42 -0800 X-CSE-ConnectionGUID: OhmlKL0zSoeFyw+z018vgw== X-CSE-MsgGUID: ih40IuXyT+WEY0M8EDioFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="115875659" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 24 Feb 2025 09:30:21 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 033A8495; Mon, 24 Feb 2025 19:30:19 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 3/7] auxdisplay: hd44780: Introduce hd44780_common_free() Date: Mon, 24 Feb 2025 19:27:40 +0200 Message-ID: <20250224173010.219024-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce hd44780_common_free() for symmetrical operation to hd44780_common_alloc(). It will allow to modify the both in the future without touching the users. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/hd44780_common.c | 6 ++++++ drivers/auxdisplay/hd44780_common.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/auxdisplay/hd44780_common.c b/drivers/auxdisplay/hd447= 80_common.c index 4ef87c3118c0..3f8a496ccb8e 100644 --- a/drivers/auxdisplay/hd44780_common.c +++ b/drivers/auxdisplay/hd44780_common.c @@ -366,5 +366,11 @@ struct hd44780_common *hd44780_common_alloc(void) } EXPORT_SYMBOL_GPL(hd44780_common_alloc); =20 +void hd44780_common_free(struct hd44780_common *hd) +{ + kfree(hd); +} +EXPORT_SYMBOL_GPL(hd44780_common_free); + MODULE_DESCRIPTION("Common functions for HD44780 (and compatibles) LCD dis= plays"); MODULE_LICENSE("GPL"); diff --git a/drivers/auxdisplay/hd44780_common.h b/drivers/auxdisplay/hd447= 80_common.h index a16aa8c29c99..fe1386e3cf79 100644 --- a/drivers/auxdisplay/hd44780_common.h +++ b/drivers/auxdisplay/hd44780_common.h @@ -30,4 +30,6 @@ int hd44780_common_blink(struct charlcd *lcd, enum charlc= d_onoff on); int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize siz= e); int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines); int hd44780_common_redefine_char(struct charlcd *lcd, char *esc); + struct hd44780_common *hd44780_common_alloc(void); +void hd44780_common_free(struct hd44780_common *hd); --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:05 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71BBA25A64C for ; Mon, 24 Feb 2025 17:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418254; cv=none; b=khHFqR+FORxx45aXxCCT7RTA2szYPQSYhw1TCCzrec/Ep+gJAVt3ay2QsjzWF45A0iKq/rkEZqlE/ub95nVcUTCkX7jQxK8zREXU1rBOmw0i8K/WTszAksiQL4cBWMHg0XIsOH3yj97gdKFRN1T6C7nk5HA6OEPK4kipxP69T0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418254; c=relaxed/simple; bh=VWVe1DTsFOp9n4K2h1AjDcSe/CR3C+t9B44JSaza3b4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WlZbB1Ha2ezqiNNKEtsOyPByYxyNeuEPR5pIKM+3DwhlaDYNV3oJAILYJSuypJFh2uKSf8UIHTp0F/9IxK7Jn/SslGhJHaRiwkYz9DRFw7gtCpMiN5UBN1W/9rPUB/TQT8wHH3yatS64agFNijMnQHDfv2jsxBoTXno18sR4vSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CIfIjk8u; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CIfIjk8u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418254; x=1771954254; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VWVe1DTsFOp9n4K2h1AjDcSe/CR3C+t9B44JSaza3b4=; b=CIfIjk8uk8x9yYP3LvkxaCAMiz1Rsw+34TXv8uUP2zSG6txBoCTND1UB UOHSfQeelZxQWywTzwBnU9lMlckAJXkJ6sHkLAIeu/SuPWMWRTcgg601G Ykesc67Sx6kRLsyU1d1LpY5yg5FwiUdV9c/DOuV2ImNsye7silmjBTG2L VQZvjoWmYmvYIuu9jsCIBMcCg+CxbyMfR6GgVsm+NT8aJ8IRLUjWkvXWr SGIh582ORydCdUObyu1fMIEi/XraqPlV1z8WuAmzOsN445v6d5H2W82Yj sT6gs1ZaYivQ10/5CC197Oma4RNI93GVAk2qxqjYCOlnKf+362dWbOf7M g==; X-CSE-ConnectionGUID: Sz9jI9bFROC7VIj5814qhw== X-CSE-MsgGUID: RGBoKxIvQrqUBNOuMAJXqw== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="66555685" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="66555685" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:42 -0800 X-CSE-ConnectionGUID: 90FlX4sqS6eO5PaaSEzluQ== X-CSE-MsgGUID: LKxnNpBLSBS0sXPUgZZ3Ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="115875662" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 24 Feb 2025 09:30:21 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0C0DA496; Mon, 24 Feb 2025 19:30:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 4/7] auxdisplay: hd44780: Make use of hd44780_common_free() Date: Mon, 24 Feb 2025 19:27:41 +0200 Message-ID: <20250224173010.219024-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the symmetrical API to free the common resources. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/hd44780.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index 1d67fe324341..ef38cb7bf13d 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -315,7 +315,7 @@ static int hd44780_probe(struct platform_device *pdev) fail2: charlcd_free(lcd); fail1: - kfree(hdc); + hd44780_common_free(hdc); return ret; } =20 @@ -326,8 +326,7 @@ static void hd44780_remove(struct platform_device *pdev) =20 charlcd_unregister(lcd); kfree(hdc->hd44780); - kfree(lcd->drvdata); - + hd44780_common_free(hdc); charlcd_free(lcd); } =20 --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:05 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0420A264A8B for ; Mon, 24 Feb 2025 17:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418256; cv=none; b=XTAimS/M3YBvYq/QVwt+6nyrUCqxR32ghLklQ7/RKyrDdipGRHV0ZdPUjl6Q6UauYPCqMbqGRYNQe4ze2kIsaQI1jAKaUzCgbX90+Cdv0bHq2OAEbwYU9x1O4XfmZ6MhyllPt5SQuIIOrItzg5+SPLTEPsgkhv97pDJgglBF6vk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418256; c=relaxed/simple; bh=ZJx/N0qiFPNt2/WxJ1XGL0hASo9jQLxxQlpmZknVIfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kaxKcpI7Qzzg7po23Ka/8pQioYjdU3KV49SEVrO0lEU+1efSBJr7N3eXxSHq6WUkOxxpjZRQB9w0qYJ8DEm/5GqfveYFbK7qo7p3DvqCNrbkBokrGJbNa3qGUxt343JmPStDdP6Ojbt3+H4X+7kG5nuLG9WzjF+9qm0lhHF03Ao= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OZZf6Em3; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OZZf6Em3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418255; x=1771954255; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZJx/N0qiFPNt2/WxJ1XGL0hASo9jQLxxQlpmZknVIfo=; b=OZZf6Em3X1pMWdKMfmR1U0qYsnbm8v7dNxgi4qlVGUiFrEsxtrMdAImk PVc61hgrnEhXmib2Jkb5SbICex4npYMvsor4QxWg64fo+RWRnXN2N9AKA c5OjLzMM/PZLGK9kB9CnwR7yUeLcPseGPXLeXke/ujlKfmrzvNENlTFy+ kF42fECt8RyTFf5Fy10cKWnM/hyw1Rh/Ved8tHPrgRsnDnwF8po3KeYXF BCwb9om6VpPgTrmxHvnV+RXGqXAlYwvTZtqnHqueO3Ku5eAXDMyINk0wL QTMXNQ+KmFaNeIxZ3yT6WsH1vIsbADUx2WGv28jTbI60MLdSMDopLYXpr A==; X-CSE-ConnectionGUID: hkAYOkAcQVawtvwrr/PEEQ== X-CSE-MsgGUID: QHqBlrQiQ9u5ZwMoP/Blug== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="66555698" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="66555698" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:42 -0800 X-CSE-ConnectionGUID: hdFdTaLEQs2tgox0fUWZgQ== X-CSE-MsgGUID: H9/CPlnOQeWZmRf9hF4TgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="115875687" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 24 Feb 2025 09:30:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1942D4BB; Mon, 24 Feb 2025 19:30:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 5/7] auxdisplay: panel: Make use of hd44780_common_free() Date: Mon, 24 Feb 2025 19:27:42 +0200 Message-ID: <20250224173010.219024-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the symmetrical API to free the common resources. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/panel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 4da142692d55..aa1d03fef22e 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -837,7 +837,7 @@ static void lcd_init(void) =20 charlcd =3D charlcd_alloc(0); if (!charlcd) { - kfree(hdc); + hd44780_common_free(hdc); return; } =20 @@ -1691,7 +1691,7 @@ static void panel_detach(struct parport *port) if (lcd.enabled) { charlcd_unregister(lcd.charlcd); lcd.initialized =3D false; - kfree(lcd.charlcd->drvdata); + hd44780_common_free(lcd.charlcd->drvdata); charlcd_free(lcd.charlcd); lcd.charlcd =3D NULL; } --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:06 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986AE264F94 for ; Mon, 24 Feb 2025 17:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418257; cv=none; b=jWRhc7nZKqOcrtI8APqRq05JXp7rwYgHULZpTLunMi8+4RKj5BxTM+Bk6Rczktz0cBoTo6hKd+IzgZaJ/UyhSjZZZPPs0OeTHq+N3jRUEeNrwzeP4y8MODsTK7+E5nr9t7sYahja0F86ICYXmJDWRGhhtVsf+qFHa9VvteI713A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418257; c=relaxed/simple; bh=DNwyL6xiGSyVGfSbFsxEePnHML6Gdi3CH6tU/PODeFg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yhf4/eJCvfaoYmU6lYIo3Vr8YRUArTP+CBp3hprP9BnQNANGlzz4GH3YGDCPc8+yJCFgEuq4sEKvXCOx/bMvCi394WFDZ/3nNcL4k2kNHHfZd+20VSFsPVwsXp0qT32pogQpFWjzcsVJqVtCGqsXQccMcYzTa8CE956Zi6FGDEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mjYK+8y1; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mjYK+8y1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418256; x=1771954256; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DNwyL6xiGSyVGfSbFsxEePnHML6Gdi3CH6tU/PODeFg=; b=mjYK+8y1ii2zrNTZbkxdL/gLavYAsx+f/45RlAVau5uTrpR7KgfO5xqW zNtBYlh15/5KtXLvDmSpx5pyf/zo4E53sAWTI6vn49xaRbqh7VuSQj0xj 7TEucvVeW2/nLndHgtQMDU4O0SeChkC8HxxgjjklqiioiUJgp1xmMuP0q ESgUSi1YQnHIYsGLfDZv0Ls9crRguLtAEaVEywPQOVMMKOliJlwGMRssD FhF0bxDoKK/+VYh3Dxymk8WSRBKjWlqXgu4Yo4bxwGr2w2cdtQwbp8hBI /I4FrlJVfwC9B//MtZRCwrvRhNRvdFT53JkAqj1/TwiQkG6eVYOTxDj6h w==; X-CSE-ConnectionGUID: eTMC/hHOSLe10OgfX1iT+A== X-CSE-MsgGUID: akwE2oYMTQCJy+aCkXhZmg== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="66555702" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="66555702" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:42 -0800 X-CSE-ConnectionGUID: URbx4UYASkiithyAk3BetA== X-CSE-MsgGUID: CxIey2w5SDCoRHT4zxnJng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="115875688" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa009.jf.intel.com with ESMTP; 24 Feb 2025 09:30:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2687B529; Mon, 24 Feb 2025 19:30:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 6/7] auxdisplay: hd44780: Call charlcd_alloc() from hd44780_common_alloc() Date: Mon, 24 Feb 2025 19:27:43 +0200 Message-ID: <20250224173010.219024-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" HD44780 APIs are operate on struct charlcd object. Moreover, the current us= ers always call charlcd_alloc() and hd44780_common_alloc(). Make the latter call the former, so eliminate the additional allocation, make it consistent with the rest of API and avoid duplication. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/hd44780.c | 18 ++++++------------ drivers/auxdisplay/hd44780_common.c | 14 ++++++++------ drivers/auxdisplay/hd44780_common.h | 4 ++-- drivers/auxdisplay/panel.c | 17 +++++------------ 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index ef38cb7bf13d..cef42656c4b0 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -222,20 +222,17 @@ static int hd44780_probe(struct platform_device *pdev) return -EINVAL; } =20 - hdc =3D hd44780_common_alloc(); - if (!hdc) - return -ENOMEM; - - lcd =3D charlcd_alloc(0); + lcd =3D hd44780_common_alloc(); if (!lcd) - goto fail1; + return -ENOMEM; =20 hd =3D kzalloc(sizeof(*hd), GFP_KERNEL); if (!hd) goto fail2; =20 + hdc =3D lcd->drvdata; hdc->hd44780 =3D hd; - lcd->drvdata =3D hdc; + for (i =3D 0; i < ifwidth; i++) { hd->pins[base + i] =3D devm_gpiod_get_index(dev, "data", i, GPIOD_OUT_LOW); @@ -313,9 +310,7 @@ static int hd44780_probe(struct platform_device *pdev) fail3: kfree(hd); fail2: - charlcd_free(lcd); -fail1: - hd44780_common_free(hdc); + hd44780_common_free(lcd); return ret; } =20 @@ -326,8 +321,7 @@ static void hd44780_remove(struct platform_device *pdev) =20 charlcd_unregister(lcd); kfree(hdc->hd44780); - hd44780_common_free(hdc); - charlcd_free(lcd); + hd44780_common_free(lcd); } =20 static const struct of_device_id hd44780_of_match[] =3D { diff --git a/drivers/auxdisplay/hd44780_common.c b/drivers/auxdisplay/hd447= 80_common.c index 3f8a496ccb8e..fb340d18fcad 100644 --- a/drivers/auxdisplay/hd44780_common.c +++ b/drivers/auxdisplay/hd44780_common.c @@ -351,24 +351,26 @@ int hd44780_common_redefine_char(struct charlcd *lcd,= char *esc) } EXPORT_SYMBOL_GPL(hd44780_common_redefine_char); =20 -struct hd44780_common *hd44780_common_alloc(void) +struct charlcd *hd44780_common_alloc(void) { struct hd44780_common *hd; + struct charlcd *lcd; =20 - hd =3D kzalloc(sizeof(*hd), GFP_KERNEL); - if (!hd) + lcd =3D charlcd_alloc(sizeof(*hd)); + if (!lcd) return NULL; =20 + hd =3D lcd->drvdata; hd->ifwidth =3D 8; hd->bwidth =3D DEFAULT_LCD_BWIDTH; hd->hwidth =3D DEFAULT_LCD_HWIDTH; - return hd; + return lcd; } EXPORT_SYMBOL_GPL(hd44780_common_alloc); =20 -void hd44780_common_free(struct hd44780_common *hd) +void hd44780_common_free(struct charlcd *lcd) { - kfree(hd); + charlcd_free(lcd); } EXPORT_SYMBOL_GPL(hd44780_common_free); =20 diff --git a/drivers/auxdisplay/hd44780_common.h b/drivers/auxdisplay/hd447= 80_common.h index fe1386e3cf79..4c87f55722b6 100644 --- a/drivers/auxdisplay/hd44780_common.h +++ b/drivers/auxdisplay/hd44780_common.h @@ -31,5 +31,5 @@ int hd44780_common_fontsize(struct charlcd *lcd, enum cha= rlcd_fontsize size); int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines); int hd44780_common_redefine_char(struct charlcd *lcd, char *esc); =20 -struct hd44780_common *hd44780_common_alloc(void); -void hd44780_common_free(struct hd44780_common *hd); +struct charlcd *hd44780_common_alloc(void); +void hd44780_common_free(struct charlcd *lcd); diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index aa1d03fef22e..91ccb9789d43 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -831,18 +831,12 @@ static void lcd_init(void) struct charlcd *charlcd; struct hd44780_common *hdc; =20 - hdc =3D hd44780_common_alloc(); - if (!hdc) + charlcd =3D hd44780_common_alloc(); + if (!charlcd) return; =20 - charlcd =3D charlcd_alloc(0); - if (!charlcd) { - hd44780_common_free(hdc); - return; - } - + hdc =3D charlcd->drvdata; hdc->hd44780 =3D &lcd; - charlcd->drvdata =3D hdc; =20 /* * Init lcd struct with load-time values to preserve exact @@ -1664,7 +1658,7 @@ static void panel_attach(struct parport *port) if (lcd.enabled) charlcd_unregister(lcd.charlcd); err_unreg_device: - charlcd_free(lcd.charlcd); + hd44780_common_free(lcd.charlcd); lcd.charlcd =3D NULL; parport_unregister_device(pprt); pprt =3D NULL; @@ -1691,8 +1685,7 @@ static void panel_detach(struct parport *port) if (lcd.enabled) { charlcd_unregister(lcd.charlcd); lcd.initialized =3D false; - hd44780_common_free(lcd.charlcd->drvdata); - charlcd_free(lcd.charlcd); + hd44780_common_free(lcd.charlcd); lcd.charlcd =3D NULL; } =20 --=20 2.45.1.3035.g276e886db78b From nobody Thu Dec 18 08:28:06 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AC30263F5B for ; Mon, 24 Feb 2025 17:30:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418233; cv=none; b=MXo6CNFGR5WFKG8z1AetylWeU5ebEADFVDPtktZ3Sj1sl1qsj5cYqluigRTTZK6jEUOGKiOGu7xG0Ko31v8n5/RDQuZ4qKNqWuSooHXHdeayhxdBXbKyZYWRtCzTvVpoQbVqRhUaKhUAYqG/5WM3uEUYCmU2mh7XiFE/4kNb9Rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740418233; c=relaxed/simple; bh=ja3yxX6RihsXvHqYTvrLS3Ry5RDySEQXHVAQ/lDoxXE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OO0sdEKYdx9p97xWQHncIbKSkk9WztarmBjLgOpBETDVFnhrWxVBd8tqiVKMPtlOFhwIZWSU0PCqInADk9+HAXLvt909uKudYhiZZq17GSuEKgHAMZ7af0yOV4sDfy0RFKwvvEH8eVBMiMGD+CfunBUEGqaMrDken40F+KlDLRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ROJ70+h4; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ROJ70+h4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740418232; x=1771954232; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ja3yxX6RihsXvHqYTvrLS3Ry5RDySEQXHVAQ/lDoxXE=; b=ROJ70+h4RPmUP7k8/G6HUW4/pFx7ssEgDrLUN12UEVipXL1CxGmirR51 sMGh3hgzbTnAVWwha9yKQnFLinrmcCrjxalQG4qbypom5/4xqzs3hf9NS 5einuuYED/IRnELLmaPoGTXkfjHWlOiQimVUXbFe6z8qIOdRLBJhAPjBz zVKLLVqbeWJQMSo8R1S9J4NwxAhi5ytpTTBmWCjj3bAbtzl1Z93yN4qWV 2kfr904UUCwn4TOpJKcroZJm+/7Ik2HXJEKwEadH4vbY79bConztbNf/V Ioc97KhRxle/L4jS1rY3ubPTHA5SFAEW2e30yAiTVNu3Kr+4m7LBVppLg g==; X-CSE-ConnectionGUID: JCb0Co4zTAiQHAjVRD+8KQ== X-CSE-MsgGUID: V7TnRK8/T3aZg2HDy0vSNg== X-IronPort-AV: E=McAfee;i="6700,10204,11355"; a="41307958" X-IronPort-AV: E=Sophos;i="6.13,312,1732608000"; d="scan'208";a="41307958" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2025 09:30:26 -0800 X-CSE-ConnectionGUID: gWWZSQJyQ5Kj7FWyOI6bbw== X-CSE-MsgGUID: qEGQn4ySQvSPAHM42qZjzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="117027896" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 24 Feb 2025 09:30:25 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 37082700; Mon, 24 Feb 2025 19:30:20 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Geert Uytterhoeven , Willy Tarreau , Ksenija Stanojevic Subject: [PATCH v1 7/7] auxdisplay: hd44780: Rename hd to hdc in hd44780_common_alloc() Date: Mon, 24 Feb 2025 19:27:44 +0200 Message-ID: <20250224173010.219024-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b In-Reply-To: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> References: <20250224173010.219024-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The hd44780_common_alloc() uses hd for local variable while the respective header uses hdc, rename to make it consistent and avoid potential confuse with the drivers that use both for different reasons. No functional changes intended. Signed-off-by: Andy Shevchenko --- drivers/auxdisplay/hd44780_common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/auxdisplay/hd44780_common.c b/drivers/auxdisplay/hd447= 80_common.c index fb340d18fcad..1792fe2a4460 100644 --- a/drivers/auxdisplay/hd44780_common.c +++ b/drivers/auxdisplay/hd44780_common.c @@ -353,17 +353,17 @@ EXPORT_SYMBOL_GPL(hd44780_common_redefine_char); =20 struct charlcd *hd44780_common_alloc(void) { - struct hd44780_common *hd; + struct hd44780_common *hdc; struct charlcd *lcd; =20 - lcd =3D charlcd_alloc(sizeof(*hd)); + lcd =3D charlcd_alloc(sizeof(*hdc)); if (!lcd) return NULL; =20 - hd =3D lcd->drvdata; - hd->ifwidth =3D 8; - hd->bwidth =3D DEFAULT_LCD_BWIDTH; - hd->hwidth =3D DEFAULT_LCD_HWIDTH; + hdc =3D lcd->drvdata; + hdc->ifwidth =3D 8; + hdc->bwidth =3D DEFAULT_LCD_BWIDTH; + hdc->hwidth =3D DEFAULT_LCD_HWIDTH; return lcd; } EXPORT_SYMBOL_GPL(hd44780_common_alloc); --=20 2.45.1.3035.g276e886db78b