Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git]
/
kernel
/
drivers
/
mfd
/
arizona-spi.c
diff --git
a/kernel/drivers/mfd/arizona-spi.c
b/kernel/drivers/mfd/arizona-spi.c
index
1e845f6
..
befbc89
100644
(file)
--- a/
kernel/drivers/mfd/arizona-spi.c
+++ b/
kernel/drivers/mfd/arizona-spi.c
@@
-27,7
+27,7
@@
static int arizona_spi_probe(struct spi_device *spi)
{
const struct spi_device_id *id = spi_get_device_id(spi);
struct arizona *arizona;
{
const struct spi_device_id *id = spi_get_device_id(spi);
struct arizona *arizona;
- const struct regmap_config *regmap_config;
+ const struct regmap_config *regmap_config
= NULL
;
unsigned long type;
int ret;
unsigned long type;
int ret;
@@
-37,20
+37,23
@@
static int arizona_spi_probe(struct spi_device *spi)
type = id->driver_data;
switch (type) {
type = id->driver_data;
switch (type) {
-#ifdef CONFIG_MFD_WM5102
case WM5102:
case WM5102:
- regmap_config = &wm5102_spi_regmap;
+ if (IS_ENABLED(CONFIG_MFD_WM5102))
+ regmap_config = &wm5102_spi_regmap;
break;
break;
-#endif
-#ifdef CONFIG_MFD_WM5110
case WM5110:
case WM8280:
case WM5110:
case WM8280:
- regmap_config = &wm5110_spi_regmap;
+ if (IS_ENABLED(CONFIG_MFD_WM5110))
+ regmap_config = &wm5110_spi_regmap;
break;
break;
-#endif
default:
default:
- dev_err(&spi->dev, "Unknown device type %ld\n",
- id->driver_data);
+ dev_err(&spi->dev, "Unknown device type %ld\n", type);
+ return -EINVAL;
+ }
+
+ if (!regmap_config) {
+ dev_err(&spi->dev,
+ "No kernel support for device type %ld\n", type);
return -EINVAL;
}
return -EINVAL;
}
@@
-66,7
+69,7
@@
static int arizona_spi_probe(struct spi_device *spi)
return ret;
}
return ret;
}
- arizona->type =
id->driver_data
;
+ arizona->type =
type
;
arizona->dev = &spi->dev;
arizona->irq = spi->irq;
arizona->dev = &spi->dev;
arizona->irq = spi->irq;
@@
-93,7
+96,6
@@
MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
static struct spi_driver arizona_spi_driver = {
.driver = {
.name = "arizona",
static struct spi_driver arizona_spi_driver = {
.driver = {
.name = "arizona",
- .owner = THIS_MODULE,
.pm = &arizona_pm_ops,
.of_match_table = of_match_ptr(arizona_of_match),
},
.pm = &arizona_pm_ops,
.of_match_table = of_match_ptr(arizona_of_match),
},