X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fspi%2Fspi_butterfly.c;h=31b7970ae463d4117580567d6b718991c0e02644;hb=2943ecf2ed32632473c06f1975db47a7aa98c10f;hp=39d9b20f2038c436a85ba8a3543d6ec57db475c6;hpb=5f765b8d68fe99c8a575265d81c62382893e1e8a;p=linux-2.6 diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c index 39d9b20f20..31b7970ae4 100644 --- a/drivers/spi/spi_butterfly.c +++ b/drivers/spi/spi_butterfly.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -245,11 +246,13 @@ static void butterfly_attach(struct parport *p) * and no way to be selective about what it binds to. */ - /* FIXME where should master->cdev.dev come from? + /* FIXME where should master->dev.parent come from? * e.g. /sys/bus/pnp0/00:0b, some PCI thing, etc * setting up a platform device like this is an ugly kluge... */ pdev = platform_device_register_simple("butterfly", -1, NULL, 0); + if (IS_ERR(pdev)) + return; master = spi_alloc_master(&pdev->dev, sizeof *pp); if (!master) { @@ -383,7 +386,7 @@ static void butterfly_detach(struct parport *p) butterfly = NULL; /* stop() unregisters child devices too */ - pdev = to_platform_device(pp->bitbang.master->cdev.dev); + pdev = to_platform_device(pp->bitbang.master->dev.parent); status = spi_bitbang_stop(&pp->bitbang); /* turn off VCC */