From nobody Thu Dec 18 22:22:58 2025 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D2261E835C for ; Sun, 23 Mar 2025 22:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742769584; cv=none; b=t0hax6+F9u5ler0niNRhmR2xvsgeSVTfnelPIwBzonppzZxQpI5Gt68x3CavYZOMA29IJsY8zX2SnD1+ZhFU3TIhmp9U1g0SHd1pTVF2ifqCu6VThutC31If1RWdeGK/vIy3xxee6Am+4eWg1m5aOFVGeDDUuPzm2wA3hoiInzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742769584; c=relaxed/simple; bh=1ZMTtP1qVi1tJ/1EB9YA8Rc5n3WQtvstvVzHXtqGWW4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RE0HCjwxsJGolb+2zlc+pVaO4ixHk3vOLhwn0dNoBt8uQItF+qGky9H85UJPOqbKiPVfWQPuC/eUUReVkLxoxmA2qi6M4T3sf/lXkKIwl+IuRuA4ObvbQkwBnle/q9vTT7PL6Msezc6NqUOccHcXukPqNaob7lzbS3t5cmuKCD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dB1iE6ev; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dB1iE6ev" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-ac3eb3fdd2eso560754666b.0 for ; Sun, 23 Mar 2025 15:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742769576; x=1743374376; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=e3Twc2HyOCZXfu7bqwpcMcsjD+r2Ct4/gngHvFw4saQ=; b=dB1iE6ev4AD20dD52kXI24mJnY9pMKdKJJr9Io2uuhBIPGggpbTdxFgzL0ZV43MD8X XgKF8cXHjmqSdtBnF9NUSlRvReDBGwJpZOHtuE80ybI5r+NeQolA5eNw7g/050GRZ1m6 Rj6FU6bEbf8VyE86XaIYhN+xGUclkOHe1fLwiOT9rL9Jm1aunrUdogQRd6pLsLM6LC3s 48RmBgWW6MZlyHHTNtW73qR3XwPnXyEmQ2bxthQtNcW0c7w0bvYXd8S1Btb8ieOqkIol 0r/R99/L8ySiw45X79zfOkRV+stnUUToXkQjtGOXgSnM8Ubl1hPDcfin8glnWGgq97Tj Ym8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742769576; x=1743374376; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e3Twc2HyOCZXfu7bqwpcMcsjD+r2Ct4/gngHvFw4saQ=; b=SXwLYMirsvE28G2R73S4Kw9ohQcfaPBugZ5f8tzttNRV2dL8E83z0XIBO9jTrMCjHU hJlCT0VpDqQzuDZp/iPhNJfb2rko7r5AFTnlSYO23yQqkzWdSQzaUtViqs+IJ3rUnO4m 3IxYoWKDxDSTNZXjMiszA0WsACx0A1/G3bFy1eQxNnzyFFNtkea7GqQ7cCu9W2UiT6eP USEp4PCdaXQarpeT3G6f+V1JU57RPo0Jql1EsFIlM8WkqwwCzo+q4A2RJ2OgnOjQVjNO +q2xjyXNac7grJ7YQnwY55q5ab61LhHsAYXLKJZ54H0YMp6gwiJht4evMSf4rTaU6wVO z7sA== X-Forwarded-Encrypted: i=1; AJvYcCUQQwtxDwz5YMACxxCufPYJZZ+53aiaC3ixPh23fO8nrpXhIKQdlAObvX3z3b88N2MmiK1RVv8FsOP/eyI=@vger.kernel.org X-Gm-Message-State: AOJu0Yye37VoMr2SZhcEN3A48PGMF5Vv/bHRv+sylNlbZwz51nh47Ry0 CWxBIzMJlojWknZBtGvmAWG0MyTHSbeQZJqcS8a9jgTbb5SYsu9NO96WN3OUdA8= X-Gm-Gg: ASbGncsqNe0c1fppTfYz/qCZ5NFspOdFTkxx9LTTubbbeaE50ner6DO6Q6voSSa8dSM VyhlhfLTPz7Fm4olSnIpYL3W2+7orFFGC+axAcs+2S3FzhEarqqBQTFkIO7u78wL09kI4A4m4iv pshOni5T73RhhMdZNRcV36r24dkvGQ5BE3oTcM0V682WXc/haoPSkZR8PMeM+FrntsLk8xe4e/n o+roSuyIh3XC+xbW4LqQyNwPscbvJ5ahNh1s0MVtbb9c85gAY1SH5cacpXOtV8tqJYh+AKm5Zvn bukxv1lzBpstCk4p3zdVwe3/ASAQy9a26KhN5JeIZ9vp0QPwmXNLm33DwLOJbk5+nr0TO5YlCSd Mn7CGsZGgVwcc6eXM0szNij2p2TlP X-Google-Smtp-Source: AGHT+IGQ8L6LLeC0zwpvMlguGkzr2gQM+jg2bpgKU+l+fqanTCryHJuZychWrZmnRDXRMuRhkKJXmw== X-Received: by 2002:a17:907:7f92:b0:abf:8f56:fe76 with SMTP id a640c23a62f3a-ac3f22b43c4mr975457666b.25.1742769576042; Sun, 23 Mar 2025 15:39:36 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3ef86e44dsm559686666b.31.2025.03.23.15.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Mar 2025 15:39:35 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Sun, 23 Mar 2025 22:39:37 +0000 Subject: [PATCH 21/34] mfd: sec: change device_type to int Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250323-s2mpg10-v1-21-d08943702707@linaro.org> References: <20250323-s2mpg10-v1-0-d08943702707@linaro.org> In-Reply-To: <20250323-s2mpg10-v1-0-d08943702707@linaro.org> To: Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Michael Turquette , Stephen Boyd , Russell King , Catalin Marinas , Will Deacon , Alexandre Belloni Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 Now that sec-i2c doesn't match device type by pointer casting anymore, we can switch the device type from unsigned long to int easily. This saves a few bytes in struct sec_pmic_dev due to member alignment. Signed-off-by: Andr=C3=A9 Draszik --- drivers/mfd/sec-common.c | 8 ++++---- drivers/mfd/sec-core.h | 4 ++-- drivers/mfd/sec-i2c.c | 2 +- drivers/mfd/sec-irq.c | 5 ++--- include/linux/mfd/samsung/core.h | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c index bec8f93a03f7fd794beade563d73610534cb96b2..48d5c9a23230d0927b9dc610166= ae3f8f1aec924 100644 --- a/drivers/mfd/sec-common.c +++ b/drivers/mfd/sec-common.c @@ -129,8 +129,8 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec= _pmic) } } =20 -int sec_pmic_probe(struct device *dev, unsigned long device_type, - unsigned int irq, struct regmap *regmap, +int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq, + struct regmap *regmap, const struct sec_pmic_probe_data *probedata, struct i2c_client *client) { @@ -214,7 +214,7 @@ int sec_pmic_probe(struct device *dev, unsigned long de= vice_type, break; default: return dev_err_probe(sec_pmic->dev, -EINVAL, - "Unsupported device type %lu\n", + "Unsupported device type %d\n", sec_pmic->device_type); } ret =3D devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs, @@ -248,7 +248,7 @@ void sec_pmic_shutdown(struct device *dev) * ignore the rest. */ dev_warn(sec_pmic->dev, - "Unsupported device %lu for manual power off\n", + "Unsupported device %d for manual power off\n", sec_pmic->device_type); return; } diff --git a/drivers/mfd/sec-core.h b/drivers/mfd/sec-core.h index 58e5b645f377cea5543a215c05957a2c49239a6f..34a801144a47bcdb5472ce5548b= cef0fe3f0926f 100644 --- a/drivers/mfd/sec-core.h +++ b/drivers/mfd/sec-core.h @@ -21,8 +21,8 @@ struct sec_pmic_probe_data { bool disable_wrstbi; }; =20 -int sec_pmic_probe(struct device *dev, unsigned long device_type, - unsigned int irq, struct regmap *regmap, +int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq, + struct regmap *regmap, const struct sec_pmic_probe_data *probedata, struct i2c_client *client); void sec_pmic_shutdown(struct device *dev); diff --git a/drivers/mfd/sec-i2c.c b/drivers/mfd/sec-i2c.c index 9f33d4569cf73461c57d101f6ca1cf2b75f22b4d..760dd89b62a1639013c9e51b6e1= a7376f15ac504 100644 --- a/drivers/mfd/sec-i2c.c +++ b/drivers/mfd/sec-i2c.c @@ -27,7 +27,7 @@ =20 struct sec_pmic_i2c_platform_data { const struct regmap_config *regmap_cfg; - unsigned long device_type; + int device_type; }; =20 static bool s2mpa01_volatile(struct device *dev, unsigned int reg) diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index dc5560a0c496917e847a40295c53e3f762b60998..cf1add30dcd0ff1ad149b483fe4= 0edf82c2b57e1 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -450,10 +450,9 @@ static const struct regmap_irq_chip s5m8767_irq_chip = =3D { int sec_irq_init(struct sec_pmic_dev *sec_pmic) { int ret =3D 0; - int type =3D sec_pmic->device_type; const struct regmap_irq_chip *sec_irq_chip; =20 - switch (type) { + switch (sec_pmic->device_type) { case S5M8767X: sec_irq_chip =3D &s5m8767_irq_chip; break; @@ -485,7 +484,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) break; default: return dev_err_probe(sec_pmic->dev, -EINVAL, - "Unsupported device type %lu\n", + "Unsupported device type %d\n", sec_pmic->device_type); } =20 diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/c= ore.h index c1102324172a9b6bd6072b5929a4866d6c9653fa..d785e101fe795a5d8f9cccf4ccc= 4232437e89416 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -67,7 +67,7 @@ struct sec_pmic_dev { struct regmap *regmap_pmic; struct i2c_client *i2c; =20 - unsigned long device_type; + int device_type; int irq; struct regmap_irq_chip_data *irq_data; }; --=20 2.49.0.395.g12beb8f557-goog