Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54628
b: refs/heads/master
c: da67529
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed May 8, 2007
1 parent 38273ac commit f5203b9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7d801afc3d4d1c8aaa0449f17b9f9ce62e16236
refs/heads/master: da6752964290567a6b4ea180d1becda75e810e87
2 changes: 1 addition & 1 deletion trunk/drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ static int lp_register(int nr, struct parport *port)
if (reset)
lp_reset(nr);

class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), NULL,
class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), port->dev,
"lp%d", nr);

printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/ppdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ static const struct file_operations pp_fops = {

static void pp_attach(struct parport *port)
{
device_create(ppdev_class, NULL, MKDEV(PP_MAJOR, port->number),
device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number),
"parport%d", port->number);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/tipar.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ tipar_register(int nr, struct parport *port)
}

class_device_create(tipar_class, NULL, MKDEV(TIPAR_MAJOR,
TIPAR_MINOR + nr), NULL, "par%d", nr);
TIPAR_MINOR + nr), port->dev, "par%d", nr);

/* Display informations */
pr_info("tipar%d: using %s (%s)\n", nr, port->name, (port->irq ==
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/i2c/busses/i2c-parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static void i2c_parport_attach (struct parport *port)
}
adapter->algo_data.data = port;
adapter->adapter.algo_data = &adapter->algo_data;
adapter->adapter.dev.parent = port->physport->dev;

if (parport_claim_or_block(adapter->pdev) < 0) {
printk(KERN_ERR "i2c-parport: Could not claim parallel port\n");
Expand Down
21 changes: 4 additions & 17 deletions trunk/drivers/spi/spi_butterfly.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/parport.h>

#include <linux/sched.h>
Expand Down Expand Up @@ -237,24 +237,16 @@ static void butterfly_attach(struct parport *p)
int status;
struct butterfly *pp;
struct spi_master *master;
struct platform_device *pdev;
struct device *dev = p->physport->dev;

if (butterfly)
if (butterfly || !dev)
return;

/* REVISIT: this just _assumes_ a butterfly is there ... no probe,
* and no way to be selective about what it binds to.
*/

/* FIXME where should master->cdev.dev 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);
master = spi_alloc_master(dev, sizeof *pp);
if (!master) {
status = -ENOMEM;
goto done;
Expand Down Expand Up @@ -366,14 +358,12 @@ static void butterfly_attach(struct parport *p)
clean0:
(void) spi_master_put(pp->bitbang.master);
done:
platform_device_unregister(pdev);
pr_debug("%s: butterfly probe, fail %d\n", p->name, status);
}

static void butterfly_detach(struct parport *p)
{
struct butterfly *pp;
struct platform_device *pdev;
int status;

/* FIXME this global is ugly ... but, how to quickly get from
Expand All @@ -386,7 +376,6 @@ static void butterfly_detach(struct parport *p)
butterfly = NULL;

/* stop() unregisters child devices too */
pdev = to_platform_device(pp->bitbang.master->cdev.dev);
status = spi_bitbang_stop(&pp->bitbang);

/* turn off VCC */
Expand All @@ -397,8 +386,6 @@ static void butterfly_detach(struct parport *p)
parport_unregister_device(pp->pd);

(void) spi_master_put(pp->bitbang.master);

platform_device_unregister(pdev);
}

static struct parport_driver butterfly_driver = {
Expand Down

0 comments on commit f5203b9

Please sign in to comment.