Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89619
b: refs/heads/master
c: 1dc3bea
h: refs/heads/master
i:
  89617: 830dccf
  89615: bdf4603
v: v3
  • Loading branch information
Stefan Richter committed Apr 18, 2008
1 parent 7aa178e commit a0a287d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 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: 7c1fca336661aaeb70b9094c4b8eaae389027509
refs/heads/master: 1dc3bea78b6cd71c2017aa5da076684c049d8b98
27 changes: 17 additions & 10 deletions trunk/drivers/firewire/fw-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,24 @@ struct fw_device {
struct fw_attribute_group attribute_group;
};

static inline struct fw_device *
fw_device(struct device *dev)
static inline struct fw_device *fw_device(struct device *dev)
{
return container_of(dev, struct fw_device, device);
}

static inline int
fw_device_is_shutdown(struct fw_device *device)
static inline int fw_device_is_shutdown(struct fw_device *device)
{
return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN;
}

static inline struct fw_device *
fw_device_get(struct fw_device *device)
static inline struct fw_device *fw_device_get(struct fw_device *device)
{
get_device(&device->device);

return device;
}

static inline void
fw_device_put(struct fw_device *device)
static inline void fw_device_put(struct fw_device *device)
{
put_device(&device->device);
}
Expand All @@ -104,12 +100,23 @@ struct fw_unit {
struct fw_attribute_group attribute_group;
};

static inline struct fw_unit *
fw_unit(struct device *dev)
static inline struct fw_unit *fw_unit(struct device *dev)
{
return container_of(dev, struct fw_unit, device);
}

static inline struct fw_unit *fw_unit_get(struct fw_unit *unit)
{
get_device(&unit->device);

return unit;
}

static inline void fw_unit_put(struct fw_unit *unit)
{
put_device(&unit->device);
}

#define CSR_OFFSET 0x40
#define CSR_LEAF 0x80
#define CSR_DIRECTORY 0xc0
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static void sbp2_release_target(struct kref *kref)
scsi_remove_host(shost);
fw_notify("released %s\n", tgt->bus_id);

put_device(&tgt->unit->device);
fw_unit_put(tgt->unit);
scsi_host_put(shost);
fw_device_put(device);
}
Expand Down Expand Up @@ -1119,7 +1119,7 @@ static int sbp2_probe(struct device *dev)
goto fail_shost_put;

fw_device_get(device);
get_device(&unit->device);
fw_unit_get(unit);

/* Initialize to values that won't match anything in our table. */
firmware_revision = 0xff000000;
Expand Down

0 comments on commit a0a287d

Please sign in to comment.