From patchwork Thu May 25 14:26:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= X-Patchwork-Id: 99053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp431554vqr; Thu, 25 May 2023 07:55:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fLbNPhxOctQEvoOAqJM5sLrItfF5u+sg3f9bfVGAWx1qS4BDxDhZh8mhHUumE/LJHqsUE X-Received: by 2002:a05:6a00:2488:b0:643:980:65b with SMTP id c8-20020a056a00248800b006430980065bmr9834133pfv.2.1685026545987; Thu, 25 May 2023 07:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685026545; cv=none; d=google.com; s=arc-20160816; b=KHS5v7ioBIbKqNvy4hokJjtHh/Jf9oXi8q3uGkoQv88+Hmg3w968szILYwO6fUWj6J heIlME4PrA+2ww3fIg4/QeidzMUBToO86eusaupyu2uUzNqZX+pxBqi5Y9QrQqB5pKXl 4gC9KSHQJaMHyXsJ7ZAC/uEUtv1ufZs2oyTEDYUvTky28xYvJAgpmiq/trL6RdyL24Ua 2HnUup+POu6BcdOxTmQPgY2Pm6zMxLUvngNcRcdVgJRt/ozZmqWHpQ0HuUbsd4lZj6WD 2XmD/cUA/69KajG9V3IgFwYk4vES9rfBtVSiZ3czNE3dXpiHvdjFbNrJVCkKsTh030pc j2Ag== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=C3UAQNcfvYSrO7NwjcGLPnwIV6p+B20zb2tpMvZ8UCQ=; b=hKA9aSb8Q4ilRe8CvRqBpYFxnSj59FxKwYlgUgUaLFZSwFCorks6BfSuhpzJP+x8qG /83pekXI2U2Uyuvt0gof1lJuYl5S3IX59AlP8GXNCyUjGHBYRVPITybkErYNAvrJXeoi wMy+iMiFXr2luNIZgO5/KtqpVUJIF4axgKenCSozwYu0Gde+lDIKJK907NPxyPcNWIp2 yZC+pBIuxQzBmCw2VydvKlJCRxViXoe3d3U+RB/pdMHlz85kXHYKNpCnu3w9SEMU1svQ 61/LumvELdkEK70g9kOezfCn2/qQSjy7nnQzUMPyY3aj6lccvkYVFtnwbK9PV8oRt6lU jjKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=nrdDvpuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y28-20020aa79e1c000000b0064f74cf9defsi1553995pfq.350.2023.05.25.07.55.33; Thu, 25 May 2023 07:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=nrdDvpuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233915AbjEYO1P (ORCPT + 99 others); Thu, 25 May 2023 10:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241631AbjEYO1J (ORCPT ); Thu, 25 May 2023 10:27:09 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B17F1B4; Thu, 25 May 2023 07:27:08 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-39831cb47c6so592989b6e.2; Thu, 25 May 2023 07:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685024827; x=1687616827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=C3UAQNcfvYSrO7NwjcGLPnwIV6p+B20zb2tpMvZ8UCQ=; b=nrdDvpuBR5mNmD/4QPb46UJPDw5hb53K3iun1XuSKuf5aD19dd5AzaG/hzWOkp4Mcu T1+tjfw9RCcmJre/EMltvE8uosN6c1cRn5THCfyIXQzgW5YdPml6WU1E4/NZbzYhf/0W et4ML8D3N2IJEKb26jt8HpdqkRdZKSwKuMHxsXzk7qrIR9ci6XZdWX1WnhAFoXmfzOyE 6rDqrYpO3Kvj7/RlTKDnLskO2U5uTkcyLlOZhdv34Xux9a9Y+EIb4/fbTidwOfDqGKTl mcsd2WYiQDYoZ9HoEWQLmGik2d2BB0ubiipKzg4tYBKUbEBqfkK+HS/yRtyHjejc3x9b /e3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685024827; x=1687616827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C3UAQNcfvYSrO7NwjcGLPnwIV6p+B20zb2tpMvZ8UCQ=; b=XKKsGgBo5IpDRy9VG1QvFAtDra1/j+IDD7OlEPRQvuka+x4v8myGJUiGPrxIKiyYgN z6WploY37TSsIommrT1Gnlyq/CNHC5b8/UAaHnE3f2YbMk1p3JhHVtEELPBkx+urNyB+ g+BPnGGwbDn5grOazQpZQ5FuTLr3G3V+unVT5OwTaWC4UoxNOGE8oU00HRD1t8QiVj9e ozNwBvoafXBY4muHD98QR6oitpnS7u+keWPP3Ek9sT4mz9Hz4bepgxoofHDi7yTSmk0R JWkJtuHgaeSNAB2b+UVVKOfjzzrNOepYMG8/21y2SIKb24pBLCG24jqQfzVoFtI4X6fE y37w== X-Gm-Message-State: AC+VfDxKRDXQLX8IO8y2CxRHKuViSqYWljesEnR8XEV5TaSUdNA3ttfV ynlGW4p/D8ap/6meF+scSGUPthHdSFU= X-Received: by 2002:aca:2b07:0:b0:38b:efe8:dfa8 with SMTP id i7-20020aca2b07000000b0038befe8dfa8mr10211291oik.51.1685024827557; Thu, 25 May 2023 07:27:07 -0700 (PDT) Received: from smeagol.fibertel.com.ar ([201.235.4.68]) by smtp.gmail.com with ESMTPSA id g10-20020a9d620a000000b006a5e0165d3esm680859otj.19.2023.05.25.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 07:27:06 -0700 (PDT) From: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= To: linux@roeck-us.net Cc: =?utf-8?q?Joaqu=C3=ADn_Ignacio_Aramend=C3=ADa?= , derekjohn.clark@gmail.com, jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (oxp-sensors) Stop passing device structure Date: Thu, 25 May 2023 11:26:52 -0300 Message-Id: <20230525142652.41981-1-samsagax@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766878395171802871?= X-GMAIL-MSGID: =?utf-8?q?1766878395171802871?= We don't need to pass device structure to write_to_ec() so we remove that from the function declaration. The same is valid for pwm_enable() and pwm_disable() as we were passing the pointer to hand it off to write_to_ec(). Signed-off-by: Joaquín Ignacio Aramendía --- drivers/hwmon/oxp-sensors.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c index a4ee757f879f..0ec7588610ad 100644 --- a/drivers/hwmon/oxp-sensors.c +++ b/drivers/hwmon/oxp-sensors.c @@ -141,7 +141,7 @@ static int read_from_ec(u8 reg, int size, long *val) return 0; } -static int write_to_ec(const struct device *dev, u8 reg, u8 value) +static int write_to_ec(u8 reg, u8 value) { int ret; @@ -156,14 +156,14 @@ static int write_to_ec(const struct device *dev, u8 reg, u8 value) return ret; } -static int oxp_pwm_enable(const struct device *dev) +static int oxp_pwm_enable(void) { - return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x01); + return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, 0x01); } -static int oxp_pwm_disable(const struct device *dev) +static int oxp_pwm_disable(void) { - return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x00); + return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, 0x00); } /* Callbacks for hwmon interface */ @@ -234,9 +234,9 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type, switch (attr) { case hwmon_pwm_enable: if (val == 1) - return oxp_pwm_enable(dev); + return oxp_pwm_enable(); else if (val == 0) - return oxp_pwm_disable(dev); + return oxp_pwm_disable(); return -EINVAL; case hwmon_pwm_input: if (val < 0 || val > 255) @@ -254,7 +254,7 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type, default: break; } - return write_to_ec(dev, OXP_SENSOR_PWM_REG, val); + return write_to_ec(OXP_SENSOR_PWM_REG, val); default: break; }