Commit 1d3029cc authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Mark Brown

spi: butterfly: use new parport device model

Modify spi-butterfly driver to use the new parallel port device model.
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e71fec73
...@@ -189,6 +189,7 @@ static void butterfly_attach(struct parport *p) ...@@ -189,6 +189,7 @@ static void butterfly_attach(struct parport *p)
struct butterfly *pp; struct butterfly *pp;
struct spi_master *master; struct spi_master *master;
struct device *dev = p->physport->dev; struct device *dev = p->physport->dev;
struct pardev_cb butterfly_cb;
if (butterfly || !dev) if (butterfly || !dev)
return; return;
...@@ -221,9 +222,9 @@ static void butterfly_attach(struct parport *p) ...@@ -221,9 +222,9 @@ static void butterfly_attach(struct parport *p)
* parport hookup * parport hookup
*/ */
pp->port = p; pp->port = p;
pd = parport_register_device(p, "spi_butterfly", memset(&butterfly_cb, 0, sizeof(butterfly_cb));
NULL, NULL, NULL, butterfly_cb.private = pp;
0 /* FLAGS */, pp); pd = parport_register_dev_model(p, "spi_butterfly", &butterfly_cb, 0);
if (!pd) { if (!pd) {
status = -ENOMEM; status = -ENOMEM;
goto clean0; goto clean0;
...@@ -321,8 +322,9 @@ static void butterfly_detach(struct parport *p) ...@@ -321,8 +322,9 @@ static void butterfly_detach(struct parport *p)
static struct parport_driver butterfly_driver = { static struct parport_driver butterfly_driver = {
.name = "spi_butterfly", .name = "spi_butterfly",
.attach = butterfly_attach, .match_port = butterfly_attach,
.detach = butterfly_detach, .detach = butterfly_detach,
.devmodel = true,
}; };
static int __init butterfly_init(void) static int __init butterfly_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment