projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spi core: stop updating dev->power.power_state
[powerpc.git]
/
drivers
/
spi
/
omap_uwire.c
diff --git
a/drivers/spi/omap_uwire.c
b/drivers/spi/omap_uwire.c
index
95183e1
..
8245b51
100644
(file)
--- a/
drivers/spi/omap_uwire.c
+++ b/
drivers/spi/omap_uwire.c
@@
-445,10
+445,19
@@
done:
return status;
}
return status;
}
+/* the spi->mode bits understood by this driver: */
+#define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH)
+
static int uwire_setup(struct spi_device *spi)
{
struct uwire_state *ust = spi->controller_state;
static int uwire_setup(struct spi_device *spi)
{
struct uwire_state *ust = spi->controller_state;
+ if (spi->mode & ~MODEBITS) {
+ dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
+ spi->mode & ~MODEBITS);
+ return -EINVAL;
+ }
+
if (ust == NULL) {
ust = kzalloc(sizeof(*ust), GFP_KERNEL);
if (ust == NULL)
if (ust == NULL) {
ust = kzalloc(sizeof(*ust), GFP_KERNEL);
if (ust == NULL)
@@
-472,7
+481,7
@@
static void uwire_off(struct uwire_spi *uwire)
spi_master_put(uwire->bitbang.master);
}
spi_master_put(uwire->bitbang.master);
}
-static int uwire_probe(struct platform_device *pdev)
+static int
__init
uwire_probe(struct platform_device *pdev)
{
struct spi_master *master;
struct uwire_spi *uwire;
{
struct spi_master *master;
struct uwire_spi *uwire;
@@
-516,7
+525,7
@@
static int uwire_probe(struct platform_device *pdev)
return status;
}
return status;
}
-static int uwire_remove(struct platform_device *pdev)
+static int
__exit
uwire_remove(struct platform_device *pdev)
{
struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev);
int status;
{
struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev);
int status;
@@
-534,8
+543,7
@@
static struct platform_driver uwire_driver = {
.bus = &platform_bus_type,
.owner = THIS_MODULE,
},
.bus = &platform_bus_type,
.owner = THIS_MODULE,
},
- .probe = uwire_probe,
- .remove = uwire_remove,
+ .remove = __exit_p(uwire_remove),
// suspend ... unuse ck
// resume ... use ck
};
// suspend ... unuse ck
// resume ... use ck
};
@@
-557,7
+565,7
@@
static int __init omap_uwire_init(void)
omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9);
}
omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9);
}
- return platform_driver_
register(&uwire_driver
);
+ return platform_driver_
probe(&uwire_driver, uwire_probe
);
}
static void __exit omap_uwire_exit(void)
}
static void __exit omap_uwire_exit(void)