From patchwork Mon Sep 2 22:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13787731 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3006B18B48E for ; Mon, 2 Sep 2024 22:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725316155; cv=none; b=KRDhC8C/4KN+oV38XoPplSOBk0BhJ4sJ97YOCV7YpH3tfn8/hZIpZjZv8EhRbvyhsiiRtW7cXA7zBmiEi9SD2a6BUOcRbHzLcHLn50ErCbVbtELe1zO8G30HIEc4DUs0NmMyYLlLVcUGWxHj5r2DABPBoJiuXxXEXQaR5eYY8KU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725316155; c=relaxed/simple; bh=Uy3gw0baEyg93YMzdsYyOhpSjIuIj+PESe4MBDgyQns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kBR92GS4hp/J9ixobaa1TiZQqqKe6s/bbPE4hgAcGREejAyr22LGJwaGNygRdxIMipWR5eOfFZD4jYLYFFy+/cPxWPsf7G+fkk0Diy/g3VamVdaCaWEu9fcIzab3aq6ydb9yEqP5iETXZ/hpO0S9JRYXKRLBqWaiw2YYdite3XQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-87.elisa-laajakaista.fi [88.113.25.87]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id b4efba77-697a-11ef-8256-005056bdfda7; Tue, 03 Sep 2024 01:28:41 +0300 (EEST) From: Andy Shevchenko To: Jonathan Cameron , David Lechner , Andy Shevchenko , Michael Hennerich , Antoniu Miclaus , Jinjie Ruan , Lorenzo Bianconi , Srinivas Pandruvada , Basavaraj Natikar , linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiri Kosina , Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Andy Shevchenko Subject: [PATCH v1 17/22] iio: light: lm3533-als: Get platform data via dev_get_platdata() Date: Tue, 3 Sep 2024 01:17:02 +0300 Message-ID: <20240902222824.1145571-18-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902222824.1145571-1-andy.shevchenko@gmail.com> References: <20240902222824.1145571-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Andy Shevchenko Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko Reviewed-by: Johan Hovold --- drivers/iio/light/lm3533-als.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c index 7800f7fa51b7..6429d951ce7f 100644 --- a/drivers/iio/light/lm3533-als.c +++ b/drivers/iio/light/lm3533-als.c @@ -754,7 +754,7 @@ static int lm3533_als_set_resistor(struct lm3533_als *als, u8 val) } static int lm3533_als_setup(struct lm3533_als *als, - struct lm3533_als_platform_data *pdata) + const struct lm3533_als_platform_data *pdata) { int ret; @@ -828,8 +828,8 @@ static const struct iio_info lm3533_als_info = { static int lm3533_als_probe(struct platform_device *pdev) { + const struct lm3533_als_platform_data *pdata; struct lm3533 *lm3533; - struct lm3533_als_platform_data *pdata; struct lm3533_als *als; struct iio_dev *indio_dev; int ret; @@ -838,7 +838,7 @@ static int lm3533_als_probe(struct platform_device *pdev) if (!lm3533) return -EINVAL; - pdata = pdev->dev.platform_data; + pdata = dev_get_platdata(&pdev->dev); if (!pdata) { dev_err(&pdev->dev, "no platform data\n"); return -EINVAL;