From nobody Wed Dec 17 11:46:51 2025 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 695E721C9EF for ; Fri, 28 Mar 2025 13:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743168676; cv=none; b=htKuOYOXZ3JEIhWU0Fd6/eibfgSCnjbcwa54jHoWKWzCM6KuSk0PtYWH4ICRfW5aHPiQy8eqJuMoG1QOhI/Tsrf+yGCtHuknrSrGvP4mNB5Sm7bcuuSV8CkIhtd+bfKTETGv1hGqZ/8huhCcW0EsgIlVX5500kOKYnjAqehm3Vo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743168676; c=relaxed/simple; bh=bllvwGesgocAPfPa0BvtiRJ2XbMS7FrEApqy00ZsPPo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gw+mY94Pkx3/S5zBANku4gtk5/yoQ82IrOLu8TOhuSW3BrJ8DCsL6ko8F6Laiq/VUzStEPopBf9REFOeWsXNW7AgZIaefr/nyUxBD2VSHD+4WM1JIWSaBRna5Ak242UXX9jL+OHGn/0r/VA8iVO1JFYuAi/MHjxfHDQ5AOJdqkk= 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=jFf4z30A; arc=none smtp.client-ip=209.85.208.41 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="jFf4z30A" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5dc89df7eccso4081540a12.3 for ; Fri, 28 Mar 2025 06:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743168663; x=1743773463; 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=KZ+pWW3wwfoO36sbVjoQMpP7epgDk59E8mIno/3xwfk=; b=jFf4z30AB4Ht+cXJWhLRG8RyM9sBRtGrfCZ5MLzAytf4YmpaMFNg60I8Y1Ki5uNOc2 iWxxlA+7is/nP2SRSjO6E6JpImKsypld7rACtiah77paGuKce3JYjflidwA1gNW8Rlep 19wUU/82e0LV2zx7KBr7Zey0u8vuVhFgsNqvdxGv7PLtLVSk0DQPED0k5CncqtM+eSdD TqsEAvLjox2fCxTUNMbQxPM7LTK92YhSc5h1ICUn62xQFEAzqH7/iIV2mEwBdW6y3W+Y CNdJSlCnFgUAVXVLe27k00PMDovIlD1Q+YzrcRDcLsy5e24orniUAoX964Wx0bZcqP6J yHPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743168663; x=1743773463; 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=KZ+pWW3wwfoO36sbVjoQMpP7epgDk59E8mIno/3xwfk=; b=TmQvodvoLA8ZtbOdTOiLueiAleoA96I4oJCPqfbQW77ryaq8wpbGcSlW8PMuMsLSWh TxA+BQHOR4vqzVHCFYbilhsQsUeSjhQeeOGT4+Ld1TxfoyGS6zWk6aw8t7w/N+mdsMya 35JS2Lk6WoN4OnxdA1oO3U1cBcibWlAfYR+qlWQxtNSvdjhUKMJNew64yEoQepFqYJWY G5i/gG1y5ld0VQfXxRRyzYho9hQsXkizs63mwSzw97kQvy0SO9cu+ws4gjRTzhe15R8m vlxTNRTwmYQpkq31JweA9a+40I3sY3SsxNlj47vgwyjeY9ZtFveb1Rk3DDVb3oo97A9M gyiA== X-Forwarded-Encrypted: i=1; AJvYcCUdvqPb66KBe6qV0UZitN8+8krvuCFt6zBC+IR0yJS13o8uIaykkXBKui+scTTvpzqhqIGp6QzRWLNpDB0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz63FVLamunEu6OeuEgYfGs+nUTH0bwR4f3lzvC1QJYXMIHBM3K 0w5pcQqp2wu6Q8ob6qtIXegPEVpwDppyt/ixYghP8KKTjnVFisS0gLRKyFPCudI= X-Gm-Gg: ASbGncuei0/z0IsRciM7FJWw1/UPD8zpY99iUEhjJg9b3lrJ5xO2iPjPVq6SE2EyQwb KBL7jKGDL3WQdaekqhdMqMWuDWFh5Ca2rNwudB2uC2LQqg5MM9xSJ3QfaWctB0SHBVix6ckNkdF LKcF3oI7cWxlrmAASOnBt1u4HlpKdLt0S2cUfmJJwJ2KxCumGx5ahs76grQokisMkfS9/5nOP+L tcc3LFK73HZy82yak8LcDJOgZvdkyqKADUpEJU6S8vGxsI2+8uEino2qOtLe9yNNbq1TlukxEcm acveTbxivmN5WEvOVRKo6EbqjT+0P7vxeFSAdN4V/gt8DB3uH0rPD7S4TSOYU/x3qakqZHSGYXR tLFk7ooY4itco1FAmYqWoraAi/FFb X-Google-Smtp-Source: AGHT+IFvr+SOv6TYL/fIDoyg5ti+FaRzN3oqSR0lDemyricExzUDfIk3kNyRHZoukM47sE3VOIFENg== X-Received: by 2002:a05:6402:518d:b0:5e7:b02b:6430 with SMTP id 4fb4d7f45d1cf-5ed8f3fd122mr6774697a12.23.1743168663146; Fri, 28 Mar 2025 06:31:03 -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 4fb4d7f45d1cf-5edc17e01f7sm1355284a12.79.2025.03.28.06.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:31:02 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Fri, 28 Mar 2025 13:29:04 +0000 Subject: [PATCH v2 18/32] 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: <20250328-s2mpg10-v2-18-b54dee33fb6b@linaro.org> References: <20250328-s2mpg10-v2-0-b54dee33fb6b@linaro.org> In-Reply-To: <20250328-s2mpg10-v2-0-b54dee33fb6b@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 | 9 ++++----- drivers/mfd/sec-core.h | 5 ++--- drivers/mfd/sec-i2c.c | 2 +- drivers/mfd/sec-irq.c | 5 ++--- include/linux/mfd/samsung/core.h | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c index bb0eb3c2d9a260ddf2fb110cc255f08a0d25230d..4871492548f5efde4248b5b3db7= 4045ec8c9d676 100644 --- a/drivers/mfd/sec-common.c +++ b/drivers/mfd/sec-common.c @@ -155,9 +155,8 @@ sec_pmic_parse_dt_pdata(struct device *dev) return pd; } =20 -int sec_pmic_probe(struct device *dev, unsigned long device_type, - unsigned int irq, struct regmap *regmap, - struct i2c_client *client) +int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq, + struct regmap *regmap, struct i2c_client *client) { struct sec_platform_data *pdata; const struct mfd_cell *sec_devs; @@ -232,7 +231,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, @@ -266,7 +265,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 a0a3488924d96f69373e7569079cfefd0544ca26..92c7558ab8b0de44a52e028eeb7= 998e38358cb4c 100644 --- a/drivers/mfd/sec-core.h +++ b/drivers/mfd/sec-core.h @@ -14,9 +14,8 @@ struct i2c_client; =20 extern const struct dev_pm_ops sec_pmic_pm_ops; =20 -int sec_pmic_probe(struct device *dev, unsigned long device_type, - unsigned int irq, struct regmap *regmap, - struct i2c_client *client); +int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq, + struct regmap *regmap, struct i2c_client *client); void sec_pmic_shutdown(struct device *dev); =20 int sec_irq_init(struct sec_pmic_dev *sec_pmic); diff --git a/drivers/mfd/sec-i2c.c b/drivers/mfd/sec-i2c.c index 41b09f5e3c49f410604a5d47e625cbb37d7f5fa2..2ccb494c8c024361c78e92be71c= e9c215757dd89 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 79a3b33441fa5ab48b4b233eb8d89b4c20c142ed..c4db58813059f07372679223ec5= 70ed07f52cd73 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -449,10 +449,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; @@ -484,7 +483,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.472.ge94155a9ec-goog