From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 882673451A7 for ; Sun, 24 May 2026 19:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779650797; cv=none; b=RBuCupqFmXvkW8MgXS1z8T6dv2egxSxFSnv2+p4p/I79d8Fgo5iX5COBfXYmUTGITuyr+XEcB7qqaoMvt+PpeshPvqZTyFtxwFT7w89GuHNSYjM+M3bBZTNuiEa8n9tBC3eqdQ9thvAPthJu+stMBiqCZqtc2zHT4Ki3qTqzzOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779650797; c=relaxed/simple; bh=mlvXNjG7xtS7M6rXy5l2zPAG4cb6n8mbspFt8yiXYpI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XChYMxjaXv30eJrmmCvsoYGW5E2lUrSVAkG8A/1QsGP1oYp8y+pU4LdgnuoQiTEkDo3WzAJfFXBOY4U13TxO7S2eWopPhPpVlkXT1v3CdBkHvhhssv8SGfOKRhNh/Bx/coEEwmVauCc+mzXoYM78JYMout5+pUkPJMXZ8vGzfyA= 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=S2XDVFAn; arc=none smtp.client-ip=209.85.214.174 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="S2XDVFAn" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2ba4a1a0325so59823125ad.0 for ; Sun, 24 May 2026 12:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779650796; x=1780255596; 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=QAlMNClfuKTegqj8KvN1jcKBNYHfMjpojHn887MhrpM=; b=S2XDVFAnUw8inOj+t+AegRi2HkTrHw4L7UeGA5kk6952EkxOIX4BBKk/hZRFdc/U1/ DwBBG+5t0ubAHSNfqlML/4hDa5ZR6+7GnyvNYmFDqKlKHwvH/v6u1KeqIWhGLfuhMyLL qsakYHThVy6CsCWwwiSlR9Y3FX/jqRoL2/sSky3irb63y8Hknt9cHfdKI2N56xl8i6Vh ed2YmgdFV/kA8pVyTclZTG3YRITKsM69wxtER4GIO98aCXyh3+85EKwwQNyUK6aE4NNE l3ngf6FF1svEttwb149YSB2q2NnJZkznymwrf+gkHIiXZMsvtCr0Gce7uj1XpXfvHGmk dHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779650796; x=1780255596; 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=QAlMNClfuKTegqj8KvN1jcKBNYHfMjpojHn887MhrpM=; b=H6c8W2yytOryP6Y3wdmU8hVg5ILV9VPn+JQh+kIFj4K4ryTafgG0tvVfAF/E3NqtFi ifLAgXtPuAKrSNb+MHn+0cL5vu8GCazaPzvEgjF3b6QyjSo1to47LUFywxA9INMWKuS5 jzXv70Jt9JtrKRCQ251w0C7EG4dGlXwa4sQObrkOI5vE6qgSyJ+42slTWhdV6gOs/v9H 6vNfnQMVhEw//C7aFs6FdmrrDrsWu42StICGc8EthYIy2dJeh/9X4jYEs3z/UHYXOMEL Ammbdh1ugYoq3XZkoFM0g0OphKK7g3xafFWi20qz1sCF2l/hbKUIT3j/YUlbPXqtSdSG wUjA== X-Forwarded-Encrypted: i=1; AFNElJ/CLAsvymsb1tT9rMi3a6V/oZNRthmhPG4g7kmEnqhmqpNbNlB8KZrcNVatCwC4ukKs8aDf2DxPHXyC4BM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4JPZRkuk5YdIUh5n/P5y18TxJjS1mO7cBiMvnuJCvVE3HBamL wk+o64GD5jH+qMgwxJARDOu61eWMLq5q0Zfmg6JM7C03ZU2sFyaMOhNI X-Gm-Gg: Acq92OHyjq8hMGUlTHDpTKdxzrY4x9Mrq5XBZtEPKAmbyAHe7NXuRITCUJR2XX14gWE wunO3ip0W2UgyXf9JNPw12x/0y0ktwIM31CKB+hDJW1ynajXKv17AlZl3itD0Di+LhJT6gE7S+S FrFpFJbyn6rsbUDzggJbGVwXJ21X2sD7Pvjdq9CN3Xi3Y7Xz8MH0yQyRltEFC+hwlrto5WiAh72 eBCIfY8in03HK3fSLkyQq1guRWMqXY41SHaO/YYQlscx4LhzT0L80X4HdZ0aSwe/Wm9cmNRwq7n 4Q0sFThMRQGqDlNaxeQGFSvrpajYOgnzED5MGAWQpoZ8EF45nXI+mn3jA/NAWvkPvSeoGMf6xmj hh6loq+gv49/6GSpXIeJK7Okq7pOPR1ACxurmDeknaCX5/Vnse8AkOJ8aK3fYIsxtT6Y7Iy55GL FSLTN/rrt6GMvLYgIHEelC6VA3RYbiJ+0XEKIqxtZVoNvxsG9+ X-Received: by 2002:a17:902:f549:b0:2bc:8f62:990b with SMTP id d9443c01a7336-2beb077fa08mr123480245ad.41.1779650795808; Sun, 24 May 2026 12:26:35 -0700 (PDT) Received: from hu-ckantibh-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bed2061c59sm16394465ad.2.2026.05.24.12.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 12:26:35 -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 18/36] iio: light: hid-sensor-als: use local struct device Date: Mon, 25 May 2026 00:55:55 +0530 Message-Id: <20260524192556.1195042-9-sanjayembedded@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260524192556.1195042-1-sanjayembedded@gmail.com> References: <20260524192556.1195042-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 --- drivers/iio/light/hid-sensor-als.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index ac654b2bbc1b..c84fb4cc5105 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -357,13 +357,14 @@ static int als_parse_report(struct platform_device *pdev, /* Function to initialize the processing for usage id */ static int hid_als_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); int ret = 0; static const char *name = "als"; struct iio_dev *indio_dev; struct als_state *als_state; - indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct als_state)); + indio_dev = devm_iio_device_alloc(dev, sizeof(struct als_state)); if (!indio_dev) return -ENOMEM; platform_set_drvdata(pdev, indio_dev); @@ -378,7 +379,7 @@ static int hid_als_probe(struct platform_device *pdev) als_sensitivity_addresses, ARRAY_SIZE(als_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; } @@ -386,7 +387,7 @@ static int hid_als_probe(struct platform_device *pdev) hsdev->usage, als_state); if (ret) { - dev_err(&pdev->dev, "failed to setup attributes\n"); + dev_err(dev, "failed to setup attributes\n"); return ret; } @@ -408,13 +409,13 @@ static int hid_als_probe(struct platform_device *pdev) ret = hid_sensor_setup_trigger(indio_dev, name, &als_state->common_attributes); if (ret < 0) { - dev_err(&pdev->dev, "trigger setup failed\n"); + dev_err(dev, "trigger setup failed\n"); return ret; } 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_trigger; } @@ -423,7 +424,7 @@ static int hid_als_probe(struct platform_device *pdev) als_state->callbacks.pdev = pdev; ret = sensor_hub_register_callback(hsdev, hsdev->usage, &als_state->callbacks); if (ret < 0) { - dev_err(&pdev->dev, "callback reg failed\n"); + dev_err(dev, "callback reg failed\n"); goto error_iio_unreg; } -- 2.34.1