From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 0CC7C313E10 for ; Sun, 24 May 2026 19:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779650913; cv=none; b=Yg5Bw1BXGPzyYwM3XZO/kHSUQRX/O6dzlrGMqRKG4OGPulSDCzol05b7WZLhBXvrQ1K4LqS7GeBX6+6umTNFpbv15O37dnLB+bo0U8djTdvE4G1N0j950q+HNEluAb6Egfpt+9ujfcOcrhGNrgB5rrl1TGLZ6oFlSJHC7NEwl30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779650913; c=relaxed/simple; bh=nw7SwQ1l1nFZsuBDD1Cx23RcHzPHJ8ppExun8H0RbYI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e1NQJ10/V2pBgEFC1vzopjEsZM6QJlxFqVA6VZdn9rEFEzg/YIFQO81GQfMxNw7p5CvMWoRBPAZFz/X0fC/shnxzekqe0N8fSgr/jBmNj7pT4uwwyl2Btv/eRXPVjpQS7AqC82UMDBXA+3bZEjZRQquVCeGmi+2HmBoxs3xsNEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Gdw3TpRV; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gdw3TpRV" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2b458ca2296so65485835ad.0 for ; Sun, 24 May 2026 12:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779650911; x=1780255711; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XFSkdTSQypKHAxtx4UgSnAMWP1eHogWGV+jnb1N+RpI=; b=Gdw3TpRVOBI8CQuKfcyoJRagimAc6XfT0xz4kZ9+pCHvxxvQ7li1KGGk/qDCCNdUc9 c83xJytnE/RWHWTvyzA/n/nk0t3SRlHuk0CzDfTcGSGC5BAJ4Sya3DMVAwhl3UD8jkln aeEK+ks3aSQGfSTmhJWHpnUpzheEJhSZc1PYaxx4N5UwaruvB61Uv7Qgvf+jDtD+KRsr RiB7+z4viohDu7oEpAndHpITFNeEKJnIULTBbsZUSMzKg/aE43+FwDq77tee5bzhZGxO loVAb8wq3jiz7M7SyYS38irLy8LGPW+aMkqRUZ/9fdd639zkFGibrKlNybQzL9d0FIsj oAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779650911; x=1780255711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XFSkdTSQypKHAxtx4UgSnAMWP1eHogWGV+jnb1N+RpI=; b=MJ1tDQdU/ldPShEHJEi1Lm+bwx3ji51Z8IwId2jp109lHudasLEvZTBbMCRkooiq6E f/4/ECc7HIfamFfA5sGCU9Frk6XKfm0JeqhVuTN6oNzj0wboTajYcCSZFGkw15aIpM8E qSxlDIA8LGIdcf2J2P3Wf+BWSJLVQ08MVzDVZvz4iJERQJ+WKF4NQgMsEQAsi7SdkIFL 4y1dn9Nd+wLkXExfIP5zD7OCgUnVthUYAee/QekQKiaG38NGpS0pHoHRqgyyr2oEoE/U AFKwu6W0+nKqHyGaokqmaOS2CDp37KXK03LHBFnDz/2GAnQ6PEt653gxMdYwi2rRP0B3 Ipdg== X-Forwarded-Encrypted: i=1; AFNElJ8II+s8OEwYWHp5z6D1QFiKTeSBa+WOYY8z9VbRX/CL1x5pN7PARkdzDE0FhyBWvYIHcfHpOUdrLVDzVrs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5L1e6vncc0SRGwmqrs30/5Ob6ol5K0oTdv0KKehLIAR76wc1C JewV1mKjVk7IdcVP9UbzUyNhhEcmPm7Mt8MEzEv5L3iFacBMm8Lo6sbs X-Gm-Gg: Acq92OEXT4UlLSXLcwW2n9bNi6ZBb6otFjTYrx1gll2HeAFy5H5ez0ZFHPZszLOyD1I 8+6CuyNdK6JGyD+KZZ48TnAIUYNXZrsU0DwIft3oGwIPB2lDeQjbFezaGKActgbi5M7yHkLCM4d rvRqDsvM3kYjNVc1Wsg+oKq7pHy4lt4fjdlERjdOiiZL7VvLZKTA1MU+ggf2LNthYTilMST3lCB Snn64JB89B76DQQ1qNDQ7eqaMzspkXyRJcybhHtk/IGT/sTthtlVGn1sbDnLp+/JI9hAaqXo+gW LPN3FYAWKVzBxNGohMDLiFuv6AdTYlgWSYjrPOFgyVxCQsM92ds4+MtACItIiPAubPK//3dNkWP G6nvdJ0glWrLbHH3889bc4CuXmtRRApYzVUGF/HToc0m1YZ0NwLEuGrl0VyBdHkJAndbRzCYVUt CNFzVOmFCEgxLpWIrEsrpdVUcb3Zo1m7EPy7T391O485EjXMFS X-Received: by 2002:a17:902:d50c:b0:2bc:78ec:54cf with SMTP id d9443c01a7336-2beb035a83bmr136372105ad.9.1779650911417; Sun, 24 May 2026 12:28:31 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb58d9fe9sm71489785ad.65.2026.05.24.12.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 12:28:30 -0700 (PDT) From: Sanjay Chitroda X-Google-Original-From: Sanjay Chitroda To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, sanjayembeddedse@gmail.com, sakari.ailus@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 23/36] iio: position: hid-sensor-custom-intel-hinge: use local struct device Date: Mon, 25 May 2026 00:58:06 +0530 Message-Id: <20260524192812.1196549-4-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260524192812.1196549-1-sanjayembedded@gmail.com> References: <20260524192812.1196549-1-sanjayembedded@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sanjay Chitroda Introduce a local struct device pointer derived from &pdev->dev. This avoids repeated &pdev->dev usage and improves readability. Signed-off-by: Sanjay Chitroda --- .../position/hid-sensor-custom-intel-hinge.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers/iio/position/hid-sensor-custom-intel-hinge.c index 0ba9d2d43913..34c7cf734018 100644 --- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c +++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c @@ -263,13 +263,14 @@ static int hinge_parse_report(struct platform_device *pdev, /* Function to initialize the processing for usage id */ static int hid_hinge_probe(struct platform_device *pdev) { - struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct hid_sensor_hub_device *hsdev = dev_get_platdata(dev); struct hinge_state *st; struct iio_dev *indio_dev; int ret; int i; - indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -287,12 +288,12 @@ static int hid_hinge_probe(struct platform_device *pdev) hinge_sensitivity_addresses, ARRAY_SIZE(hinge_sensitivity_addresses)); if (ret) { - dev_err(&pdev->dev, "failed to setup common attributes\n"); + dev_err(dev, "failed to setup common attributes\n"); return ret; } indio_dev->num_channels = ARRAY_SIZE(hinge_channels); - indio_dev->channels = devm_kmemdup(&pdev->dev, hinge_channels, + indio_dev->channels = devm_kmemdup(dev, hinge_channels, sizeof(hinge_channels), GFP_KERNEL); if (!indio_dev->channels) return -ENOMEM; @@ -301,7 +302,7 @@ static int hid_hinge_probe(struct platform_device *pdev) (struct iio_chan_spec *)indio_dev->channels, hsdev->usage, st); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } @@ -313,7 +314,7 @@ static int hid_hinge_probe(struct platform_device *pdev) ret = hid_sensor_setup_trigger(indio_dev, indio_dev->name, &st->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } @@ -322,13 +323,13 @@ static int hid_hinge_probe(struct platform_device *pdev) st->callbacks.pdev = pdev; ret = sensor_hub_register_callback(hsdev, hsdev->usage, &st->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_remove_trigger; } ret = iio_device_register(indio_dev); if (ret) { - dev_err(&pdev->dev, "device register failed\n"); + dev_err(dev, "device register failed\n"); goto error_remove_callback; } -- 2.34.1