summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-butterfly.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-12-02 19:17:51 +0530
committerMark Brown <broonie@kernel.org>2015-12-02 19:38:16 +0000
commit1d3029cc5f17081afdc2d6b7b50f9d0366cdbae1 (patch)
tree32de0ee4d2d6e1eacc674a3badc538bd8223365a /drivers/spi/spi-butterfly.c
parente71fec7352c83af889ea36e164f1f6f895b0aaaf (diff)
spi: butterfly: use new parport device model
Modify spi-butterfly driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-butterfly.c')
-rw-r--r--drivers/spi/spi-butterfly.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/spi/spi-butterfly.c b/drivers/spi/spi-butterfly.c
index f16ef7fb10f1..22a31e4a1a11 100644
--- a/drivers/spi/spi-butterfly.c
+++ b/drivers/spi/spi-butterfly.c
@@ -189,6 +189,7 @@ static void butterfly_attach(struct parport *p)
struct butterfly *pp;
struct spi_master *master;
struct device *dev = p->physport->dev;
+ struct pardev_cb butterfly_cb;
if (butterfly || !dev)
return;
@@ -221,9 +222,9 @@ static void butterfly_attach(struct parport *p)
* parport hookup
*/
pp->port = p;
- pd = parport_register_device(p, "spi_butterfly",
- NULL, NULL, NULL,
- 0 /* FLAGS */, pp);
+ memset(&butterfly_cb, 0, sizeof(butterfly_cb));
+ butterfly_cb.private = pp;
+ pd = parport_register_dev_model(p, "spi_butterfly", &butterfly_cb, 0);
if (!pd) {
status = -ENOMEM;
goto clean0;
@@ -321,8 +322,9 @@ static void butterfly_detach(struct parport *p)
static struct parport_driver butterfly_driver = {
.name = "spi_butterfly",
- .attach = butterfly_attach,
+ .match_port = butterfly_attach,
.detach = butterfly_detach,
+ .devmodel = true,
};
static int __init butterfly_init(void)