From patchwork Sun Jun 15 14:40:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 897858 Received: from smtp.smtpout.orange.fr (smtp-81.smtpout.orange.fr [80.12.242.81]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E46FE2E11CC; Sun, 15 Jun 2025 14:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998511; cv=none; b=lV0aow0TW3AmS+6z1T+wf/OSE4YDDVCchcjgR3ZJdwbrasR3vAXRK3uZ2o6rhItCm6+ZaDm3bu4y6duMUxXAFU+eiBYYqdM/k//2DPMfVZ9PS+lnl7AmF0jT+Y6H+n2MfzwNbCxI/X0NYQeV0WGe7VosF5W5wWF1ZYCSZfDkAZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998511; c=relaxed/simple; bh=tiXwc+MTqLNTCA+GGAffuJEYTKrQOETl5cwJ/U7l4Wc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=l+I6QzD0mAKEFFv4NXmi0NmZTX9ZV78dZDhK+F2sn1JKLdEj1/VlHWABK/pVjjrNXpxjJSSTktp9g5sjpLg0hj4lS/zetgH40NxQWAKdg1CT9/2r3ng6Sr5odv/K5Xn8o2+4NIR0nrZplnVRt9ltSWfqjTICMAZxVdS0Z5nqkAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=sNGYddpn; arc=none smtp.client-ip=80.12.242.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="sNGYddpn" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id QoX9uGUEmnYcQQoX9us9PO; Sun, 15 Jun 2025 16:40:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1749998433; bh=J/1FGeQ5losJC3i1QB3jB7LngAtvb3hS/jlqq0vPi90=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sNGYddpnsM1FNVQ0mpTPxKYkYZpuElkpvEofO8pTEkzDxZuiN4IGB9ei9FQ+aFpH5 feDr7/9JgHJ6d0/5QIaHhvj8MULV6+iMUuR0QhU0sDiGTyeG5w7h+pS0QqZR/sDrv6 8urracpCx8YzXU7G8OnL+CINwu3/a81a8DLIXDm9XvsFCnjNmFAESRUxzRdbno7QJt oenGF2OEjAvwjky0S0inV5ZbWs9l3aCAka2OdeOYDFsS/N2gXdh3QPVy/pT3qs4dbW psmgi6zC7J5xT402020RRUj25+9NVl+/Pet2rKUDs6GYxrrPc++Ta/ly3ZZtk0+T4G rmHhmKxLjoZAA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 15 Jun 2025 16:40:33 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Lee Jones Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-omap@vger.kernel.org Subject: [PATCH 1/3] mfd: tps65219: Constify struct regmap_irq_sub_irq_map and tps65219_chip_data Date: Sun, 15 Jun 2025 16:40:20 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'struct regmap_irq_sub_irq_map' and 'struct tps65219_chip_data' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increases overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 27413 10272 256 37941 9435 drivers/mfd/tps65219.o After: ===== text data bss dec hex filename 27893 9792 256 37941 9435 drivers/mfd/tps65219.o Signed-off-by: Christophe JAILLET --- Compile tested only --- drivers/mfd/tps65219.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c index fd390600fbf0..62669041e0d9 100644 --- a/drivers/mfd/tps65219.c +++ b/drivers/mfd/tps65219.c @@ -238,7 +238,7 @@ static unsigned int tps65214_bit4_offsets[] = { TPS65214_REG_INT_BUCK_3_POS }; static unsigned int tps65214_bit5_offsets[] = { TPS65214_REG_INT_LDO_1_2_POS }; static unsigned int tps65214_bit7_offsets[] = { TPS65214_REG_INT_PB_POS }; -static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = { +static const struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets), @@ -249,7 +249,7 @@ static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), }; -static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { +static const struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets), @@ -260,7 +260,7 @@ static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), }; -static struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets[] = { +static const struct regmap_irq_sub_irq_map tps65214_sub_irq_offsets[] = { REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit0_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit1_offsets), REGMAP_IRQ_MAIN_REG_OFFSET(tps65214_bit2_offsets), @@ -455,7 +455,7 @@ struct tps65219_chip_data { int n_cells; }; -static struct tps65219_chip_data chip_info_table[] = { +static const struct tps65219_chip_data chip_info_table[] = { [TPS65214] = { .irq_chip = &tps65214_irq_chip, .cells = tps65214_cells, @@ -476,7 +476,7 @@ static struct tps65219_chip_data chip_info_table[] = { static int tps65219_probe(struct i2c_client *client) { struct tps65219 *tps; - struct tps65219_chip_data *pmic; + const struct tps65219_chip_data *pmic; bool pwr_button; int ret; From patchwork Sun Jun 15 14:42:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 897226 Received: from smtp.smtpout.orange.fr (smtp-75.smtpout.orange.fr [80.12.242.75]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88B0F2E11CC for ; Sun, 15 Jun 2025 14:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.75 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998626; cv=none; b=R4cLF/oi8aPlCjnYQEPqLuol7ddsGvUw7W7hrCMVE8hsIwua5nEcbCXLegotGZwnWfsonOuIoOrV5fHM6r/GLQN0HKLBxbpdWvrjJy2qTVIyU8NBNgEtD/J+VVI1rmYrfrwvwf6n5pjr+XV92MOrk943Ef+T6OV39mp9nM2lqhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998626; c=relaxed/simple; bh=fN/4D9KNEY1A4dUjx3qSg5ehtlm/LYqYjbPkXvN9BsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f4ck2FcVudHlOYnCTmoApaa+URbz888GX32EHpEL4JiGcrwWRhXnf5+bkwAvHOylaHeR5cAIPFGL0xss3TvdZA2SfMm7A7f7YBTo0Cq75Kwmk27WcrsiqcmLIGoECs7GffUwrNV0gvfZHrgXRdT4tpHC7nX8W4uoNFXhi9O2T6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=I8WjhMMo; arc=none smtp.client-ip=80.12.242.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="I8WjhMMo" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id QoZ6uGCgjmPDOQoZ6uOiyE; Sun, 15 Jun 2025 16:42:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1749998554; bh=cwWk346lUaBuGbguyfcH5aUN2Z+loYZlD8bqgpSsoXs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=I8WjhMMo583sTRRFc/4P1l2xMIr/Y10NPRRusHVxv7Zf+/2C39kN4N4ukuPbKa8Hq doG1h+6dQmEAaanBvhk9Na0PCHukTPF3wgIQuqGPnP/1+fMdrA5jeCZhyhCI743ENd xG36x74YurvSXHdcwprfSTqQTXqiFk5OrK+k1chmIpWqSDoZOSarUPd8j3KNJIoXcS 3bYbPXhOO1xqGFVi2jo2lU27tzenC8UprqAf/blOR85Dltvt4FReJp56cyUxiB50jq oapTEVqoEMoWhj90zD/554NEOt8Ha9oWpgmYqATiImx+tP40AIqzsJZLDcBABsYVZv qSWp0xADG8hVQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 15 Jun 2025 16:42:34 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: aaro.koskinen@iki.fi, andreas@kemnade.info, khilman@baylibre.com, rogerq@kernel.org, tony@atomide.com, Lee Jones Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/3] mfd: tps65219: Remove an unused field from 'struct tps65219' Date: Sun, 15 Jun 2025 16:42:18 +0200 Message-ID: <1f5e2e582ad97e9863ed5885266ae271f2be32bc.1749998382.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since commit 3df4c6367520 ("mfd: tps65219: Add support for soft shutdown via sys-off API"), the 'nb' field from 'struct tps65219' is unused. Remove it. Also remove the now useless #include for the same reason. Signed-off-by: Christophe JAILLET --- Compile tested only. --- include/linux/mfd/tps65219.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h index 3e8d29189267..690002932377 100644 --- a/include/linux/mfd/tps65219.h +++ b/include/linux/mfd/tps65219.h @@ -10,7 +10,6 @@ #define MFD_TPS65219_H #include -#include #include #include @@ -440,7 +439,6 @@ enum tps65219_irqs { * @regmap: Regmap for accessing the device registers * @chip_id: Chip ID * @irq_data: Regmap irq data used for the irq chip - * @nb: notifier block for the restart handler */ struct tps65219 { struct device *dev; @@ -448,7 +446,6 @@ struct tps65219 { unsigned int chip_id; struct regmap_irq_chip_data *irq_data; - struct notifier_block nb; }; #endif /* MFD_TPS65219_H */ From patchwork Sun Jun 15 14:42:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 897857 Received: from smtp.smtpout.orange.fr (smtp-75.smtpout.orange.fr [80.12.242.75]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 784DF1917E3 for ; Sun, 15 Jun 2025 14:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.75 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998627; cv=none; b=sZ9py7HA8SQHHCQ63hHJI0BH/jO7j1zeddqRGiJ/RuS9jx6PXbCe6rDK4cJwNTTQxOq3xE5Dki4cxTR+zFw2BNPIZvc4BgslD0Bekk6vBgZa3GFrrO1KDR67Kf9pAyvOEiWZuogJKTquJR/DnltzPsC/GarZlHYCTj2XxZ7/paM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749998627; c=relaxed/simple; bh=XdId1Ksl8i8oMowatgaQaHL/wH3H03NmiVks0tax8fQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KKtgD4E8kOoxW10iVzF53UhDpUmqbIXYqTBd9Z/Xz+icWU0hznWq6uSoDpKhe+7SaPlsyEi4HtGYNlZEj1mKCuvr7/5X/ftPYKacT7IpcFxYauavu8KBxDKMJL1cnr0PRK0aE6ubPUULNISHlpLlV53kAI7Hz1goa13FMHqpMgc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=AHaZoSLs; arc=none smtp.client-ip=80.12.242.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="AHaZoSLs" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id QoZ6uGCgjmPDOQoZFuOjAS; Sun, 15 Jun 2025 16:42:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1749998562; bh=esOjXohqvupssHw1wcuvrTlVeI2AopS0pXECcAzGJJg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=AHaZoSLs8p2VA9+5ZY3KCPMHTrmGDf7amDnCnAIW7wky/6kaYDPQ6baCQEm8sK+cL dV9yAu9QPXcrrg0qUNqM+W28qP0348Jr7tJveRm7dtLiPSe/k8IWQmwK3Hz5mRR5AH g37EP2+n/F72AymSE5QKhyIGIYKdHo2nu5BFhOMB+JWwWioNVUcuhAet2AjsnLX5Tr qQh+FSdGc+IhwjT9K01ORyIOoGVjJe71kFeBNSdFJ2pUyKQL4TSGr0Oqw3q0sEJLTh yJdQBfeZMgX3voXUGaVa9l/X6vNyvhTOOe+XNhKFyQ9WYdfRIZAg9MVjf1HOtNQkRY ZKokaDblLK7NQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 15 Jun 2025 16:42:42 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: aaro.koskinen@iki.fi, andreas@kemnade.info, khilman@baylibre.com, rogerq@kernel.org, tony@atomide.com, Lee Jones Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 3/3] mfd: tps65219: Remove another unused field from 'struct tps65219' Date: Sun, 15 Jun 2025 16:42:19 +0200 Message-ID: <410d08b7043f8c724d0dee29c06b7029fb933a47.1749998382.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The 'chip_id' field from 'struct tps65219' is unused. Remove it. Signed-off-by: Christophe JAILLET --- Compile tested only. --- drivers/mfd/tps65219.c | 5 +++-- include/linux/mfd/tps65219.h | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c index 62669041e0d9..cc6121fd0ec3 100644 --- a/drivers/mfd/tps65219.c +++ b/drivers/mfd/tps65219.c @@ -477,6 +477,7 @@ static int tps65219_probe(struct i2c_client *client) { struct tps65219 *tps; const struct tps65219_chip_data *pmic; + unsigned int chip_id; bool pwr_button; int ret; @@ -487,8 +488,8 @@ static int tps65219_probe(struct i2c_client *client) i2c_set_clientdata(client, tps); tps->dev = &client->dev; - tps->chip_id = (uintptr_t)i2c_get_match_data(client); - pmic = &chip_info_table[tps->chip_id]; + chip_id = (uintptr_t)i2c_get_match_data(client); + pmic = &chip_info_table[chip_id]; tps->regmap = devm_regmap_init_i2c(client, &tps65219_regmap_config); if (IS_ERR(tps->regmap)) { diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h index 690002932377..55234e771ba7 100644 --- a/include/linux/mfd/tps65219.h +++ b/include/linux/mfd/tps65219.h @@ -437,14 +437,12 @@ enum tps65219_irqs { * * @dev: MFD device * @regmap: Regmap for accessing the device registers - * @chip_id: Chip ID * @irq_data: Regmap irq data used for the irq chip */ struct tps65219 { struct device *dev; struct regmap *regmap; - unsigned int chip_id; struct regmap_irq_chip_data *irq_data; };