提交 5b557298 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

misc: at25: Make driver OF independent again

The commit f60e7074 ("misc: at25: Make use of device property API")
made a good job by enabling the driver for non-OF platforms, but the
recent commit 604288bc ("nvmem: eeprom: at25: fix type compiler warnings")
brought that back.

Restore greatness of the driver once again.

Fixes: eab61fb1 ("nvmem: eeprom: at25: fram discovery simplification")
Fixes: fd307a4a ("nvmem: prepare basics for FRAM support")
Acked-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211125212729.86585-2-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5d331b59
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/eeprom.h> #include <linux/spi/eeprom.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/math.h> #include <linux/math.h>
/* /*
...@@ -381,13 +379,14 @@ static int at25_probe(struct spi_device *spi) ...@@ -381,13 +379,14 @@ static int at25_probe(struct spi_device *spi)
int sr; int sr;
u8 id[FM25_ID_LEN]; u8 id[FM25_ID_LEN];
u8 sernum[FM25_SN_LEN]; u8 sernum[FM25_SN_LEN];
bool is_fram;
int i; int i;
const struct of_device_id *match;
bool is_fram = 0;
match = of_match_device(of_match_ptr(at25_of_match), &spi->dev); err = device_property_match_string(&spi->dev, "compatible", "cypress,fm25");
if (match && !strcmp(match->compatible, "cypress,fm25")) if (err >= 0)
is_fram = 1; is_fram = true;
else
is_fram = false;
/* Chip description */ /* Chip description */
if (!spi->dev.platform_data) { if (!spi->dev.platform_data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册