[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211125213203.86693-4-andriy.shevchenko@linux.intel.com>
Date: Thu, 25 Nov 2021 23:31:56 +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 03/10] misc: at25: Check new property ("address-width") first
As it's done elsewhere in at25_fw_to_chip() check new property
("address-width") first.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/misc/eeprom/at25.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 027840c73fc8..86f5433d0278 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -327,13 +327,15 @@ static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
}
chip->page_size = val;
- err = device_property_read_u32(dev, "at25,addr-mode", &val);
+ err = device_property_read_u32(dev, "address-width", &val);
if (err) {
- err = device_property_read_u32(dev, "address-width", &val);
+ err = device_property_read_u32(dev, "at25,addr-mode", &val);
if (err) {
dev_err(dev, "Error: missing \"address-width\" property\n");
return err;
}
+ chip->flags = (u16)val;
+ } else {
switch (val) {
case 9:
chip->flags |= EE_INSTR_BIT3_IS_ADDR;
@@ -355,8 +357,6 @@ static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
}
if (device_property_present(dev, "read-only"))
chip->flags |= EE_READONLY;
- } else {
- chip->flags = (u16)val;
}
return 0;
}
--
2.33.0
Powered by blists - more mailing lists