lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211125213203.86693-5-andriy.shevchenko@linux.intel.com>
Date:   Thu, 25 Nov 2021 23:31:57 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-kernel@...r.kernel.org
Cc:     Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Prchal <jiri.prchal@...ignal.cz>
Subject: [PATCH v1 04/10] misc: at25: Get platform data via dev_get_platdata()

Access to platform data via dev_get_platdata() getter to make code cleaner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 drivers/misc/eeprom/at25.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 86f5433d0278..b235f20c56da 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -378,7 +378,7 @@ MODULE_DEVICE_TABLE(spi, at25_spi_ids);
 static int at25_probe(struct spi_device *spi)
 {
 	struct at25_data	*at25 = NULL;
-	struct spi_eeprom	chip;
+	struct spi_eeprom	chip, *pdata;
 	int			err;
 	int			sr;
 	u8 id[FM25_ID_LEN];
@@ -393,7 +393,8 @@ static int at25_probe(struct spi_device *spi)
 		is_fram = false;
 
 	/* Chip description */
-	if (!spi->dev.platform_data) {
+	pdata = dev_get_platdata(&spi->dev);
+	if (!pdata) {
 		if (is_fram) {
 			/* We file fields for FRAM case later on */
 			memset(&chip, 0, sizeof(chip));
@@ -403,7 +404,7 @@ static int at25_probe(struct spi_device *spi)
 				return err;
 		}
 	} else
-		chip = *(struct spi_eeprom *)spi->dev.platform_data;
+		chip = *pdata;
 
 	/* Ping the chip ... the status register is pretty portable,
 	 * unlike probing manufacturer IDs.  We do expect that system
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ