]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Jul 2013 18:02:58 +0000 (11:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Jul 2013 18:02:58 +0000 (11:02 -0700)
Pull firewire updates from Stefan Richter:
 "Make struct ieee1394_device_id.driver_data actually avaliable to 1394
  protocol drivers.  This is especially useful to 1394 audio drivers for
  model-specific parameters and methods"

* tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire: remove support of fw_driver.driver.probe and .remove methods
  firewire: introduce fw_driver.probe and .remove methods

1  2 
drivers/staging/fwserial/fwserial.c
sound/firewire/scs1x.c

index 4e1cd5e9ea37f68f785f79471a8e652626de0657,a8399f9c9392bfaadef7d05044d6e29db8cd052f..ff92f34e4746f3e9e0239abe945c866115e86605
@@@ -18,8 -18,6 +18,8 @@@
   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   */
  
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/sched.h>
  #include <linux/slab.h>
  #include <linux/device.h>
@@@ -103,16 -101,13 +103,16 @@@ struct fwtty_transaction 
  };
  
  #define to_device(a, b)                       (a->b)
 -#define fwtty_err(p, s, v...)         dev_err(to_device(p, device), s, ##v)
 -#define fwtty_info(p, s, v...)                dev_info(to_device(p, device), s, ##v)
 -#define fwtty_notice(p, s, v...)      dev_notice(to_device(p, device), s, ##v)
 -#define fwtty_dbg(p, s, v...)         \
 -              dev_dbg(to_device(p, device), "%s: " s, __func__, ##v)
 -#define fwtty_err_ratelimited(p, s, v...) \
 -              dev_err_ratelimited(to_device(p, device), s, ##v)
 +#define fwtty_err(p, fmt, ...)                                                \
 +      dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
 +#define fwtty_info(p, fmt, ...)                                               \
 +      dev_info(to_device(p, device), fmt, ##__VA_ARGS__)
 +#define fwtty_notice(p, fmt, ...)                                     \
 +      dev_notice(to_device(p, device), fmt, ##__VA_ARGS__)
 +#define fwtty_dbg(p, fmt, ...)                                                \
 +      dev_dbg(to_device(p, device), "%s: " fmt, __func__, ##__VA_ARGS__)
 +#define fwtty_err_ratelimited(p, fmt, ...)                            \
 +      dev_err_ratelimited(to_device(p, device), fmt, ##__VA_ARGS__)
  
  #ifdef DEBUG
  static inline void debug_short_write(struct fwtty_port *port, int c, int n)
                spin_lock_bh(&port->lock);
                avail = dma_fifo_avail(&port->tx_fifo);
                spin_unlock_bh(&port->lock);
 -              fwtty_dbg(port, "short write: avail:%d req:%d wrote:%d",
 +              fwtty_dbg(port, "short write: avail:%d req:%d wrote:%d\n",
                          avail, c, n);
        }
  }
@@@ -202,22 -197,22 +202,22 @@@ static void fwtty_log_tx_error(struct f
  {
        switch (rcode) {
        case RCODE_SEND_ERROR:
 -              fwtty_err_ratelimited(port, "card busy");
 +              fwtty_err_ratelimited(port, "card busy\n");
                break;
        case RCODE_ADDRESS_ERROR:
 -              fwtty_err_ratelimited(port, "bad unit addr or write length");
 +              fwtty_err_ratelimited(port, "bad unit addr or write length\n");
                break;
        case RCODE_DATA_ERROR:
 -              fwtty_err_ratelimited(port, "failed rx");
 +              fwtty_err_ratelimited(port, "failed rx\n");
                break;
        case RCODE_NO_ACK:
 -              fwtty_err_ratelimited(port, "missing ack");
 +              fwtty_err_ratelimited(port, "missing ack\n");
                break;
        case RCODE_BUSY:
 -              fwtty_err_ratelimited(port, "remote busy");
 +              fwtty_err_ratelimited(port, "remote busy\n");
                break;
        default:
 -              fwtty_err_ratelimited(port, "failed tx: %d", rcode);
 +              fwtty_err_ratelimited(port, "failed tx: %d\n", rcode);
        }
  }
  
@@@ -292,7 -287,7 +292,7 @@@ static void __fwtty_restart_tx(struct f
                schedule_delayed_work(&port->drain, 0);
        avail = dma_fifo_avail(&port->tx_fifo);
  
 -      fwtty_dbg(port, "fifo len: %d avail: %d", len, avail);
 +      fwtty_dbg(port, "fifo len: %d avail: %d\n", len, avail);
  }
  
  static void fwtty_restart_tx(struct fwtty_port *port)
@@@ -328,7 -323,7 +328,7 @@@ static void fwtty_update_port_status(st
        if (delta & TIOCM_CTS)
                ++port->icount.cts;
  
 -      fwtty_dbg(port, "status: %x delta: %x", status, delta);
 +      fwtty_dbg(port, "status: %x delta: %x\n", status, delta);
  
        if (delta & TIOCM_CAR) {
                tty = tty_port_tty_get(&port->port);
@@@ -514,7 -509,7 +514,7 @@@ static void fwtty_emit_breaks(struct wo
        n = (elapsed * port->cps) / HZ + 1;
        port->break_last = now;
  
 -      fwtty_dbg(port, "sending %d brks", n);
 +      fwtty_dbg(port, "sending %d brks\n", n);
  
        while (n) {
                t = min(n, 16);
@@@ -575,7 -570,7 +575,7 @@@ static int fwtty_buffer_rx(struct fwtty
        size_t size = (n + sizeof(struct buffered_rx) + 0xFF) & ~0xFF;
  
        if (port->buffered + n > HIGH_WATERMARK) {
 -              fwtty_err_ratelimited(port, "overflowed rx buffer: buffered: %d new: %zu wtrmk: %d",
 +              fwtty_err_ratelimited(port, "overflowed rx buffer: buffered: %d new: %zu wtrmk: %d\n",
                                      port->buffered, n, HIGH_WATERMARK);
                return 0;
        }
@@@ -604,7 -599,7 +604,7 @@@ static int fwtty_rx(struct fwtty_port *
        unsigned lsr;
        int err = 0;
  
 -      fwtty_dbg(port, "%d", n);
 +      fwtty_dbg(port, "%d\n", n);
        profile_size_distrib(port->stats.reads, n);
  
        if (port->write_only) {
@@@ -694,7 -689,7 +694,7 @@@ static void fwtty_port_handler(struct f
        rcu_read_unlock();
        if (!peer || peer != rcu_access_pointer(port->peer)) {
                rcode = RCODE_ADDRESS_ERROR;
 -              fwtty_err_ratelimited(port, "ignoring unauthenticated data");
 +              fwtty_err_ratelimited(port, "ignoring unauthenticated data\n");
                goto respond;
        }
  
@@@ -751,7 -746,7 +751,7 @@@ static void fwtty_tx_complete(struct fw
        struct fwtty_port *port = txn->port;
        int len;
  
 -      fwtty_dbg(port, "rcode: %d", rcode);
 +      fwtty_dbg(port, "rcode: %d\n", rcode);
  
        switch (rcode) {
        case RCODE_COMPLETE:
@@@ -814,7 -809,7 +814,7 @@@ static int fwtty_tx(struct fwtty_port *
                n = dma_fifo_out_pend(&port->tx_fifo, &txn->dma_pended);
                spin_unlock_bh(&port->lock);
  
 -              fwtty_dbg(port, "out: %u rem: %d", txn->dma_pended.len, n);
 +              fwtty_dbg(port, "out: %u rem: %d\n", txn->dma_pended.len, n);
  
                if (n < 0) {
                        kmem_cache_free(fwtty_txn_cache, txn);
                                profile_size_distrib(port->stats.txns, 0);
                        else {
                                ++port->stats.fifo_errs;
 -                              fwtty_err_ratelimited(port, "fifo err: %d", n);
 +                              fwtty_err_ratelimited(port, "fifo err: %d\n",
 +                                                    n);
                        }
                        break;
                }
@@@ -883,7 -877,7 +883,7 @@@ static void fwtty_write_xchar(struct fw
  
        ++port->stats.xchars;
  
 -      fwtty_dbg(port, "%02x", ch);
 +      fwtty_dbg(port, "%02x\n", ch);
  
        rcu_read_lock();
        peer = rcu_dereference(port->peer);
@@@ -970,7 -964,7 +970,7 @@@ static void fwtty_port_dtr_rts(struct t
  {
        struct fwtty_port *port = to_port(tty_port, port);
  
 -      fwtty_dbg(port, "on/off: %d", on);
 +      fwtty_dbg(port, "on/off: %d\n", on);
  
        spin_lock_bh(&port->lock);
        /* Don't change carrier state if this is a console */
@@@ -998,7 -992,7 +998,7 @@@ static int fwtty_port_carrier_raised(st
  
        rc = (port->mstatus & TIOCM_CAR);
  
 -      fwtty_dbg(port, "%d", rc);
 +      fwtty_dbg(port, "%d\n", rc);
  
        return rc;
  }
@@@ -1183,7 -1177,7 +1183,7 @@@ static int fwtty_write(struct tty_struc
        struct fwtty_port *port = tty->driver_data;
        int n, len;
  
 -      fwtty_dbg(port, "%d", c);
 +      fwtty_dbg(port, "%d\n", c);
        profile_size_distrib(port->stats.writes, c);
  
        spin_lock_bh(&port->lock);
@@@ -1210,7 -1204,7 +1210,7 @@@ static int fwtty_write_room(struct tty_
        n = dma_fifo_avail(&port->tx_fifo);
        spin_unlock_bh(&port->lock);
  
 -      fwtty_dbg(port, "%d", n);
 +      fwtty_dbg(port, "%d\n", n);
  
        return n;
  }
@@@ -1224,7 -1218,7 +1224,7 @@@ static int fwtty_chars_in_buffer(struc
        n = dma_fifo_level(&port->tx_fifo);
        spin_unlock_bh(&port->lock);
  
 -      fwtty_dbg(port, "%d", n);
 +      fwtty_dbg(port, "%d\n", n);
  
        return n;
  }
@@@ -1233,7 -1227,7 +1233,7 @@@ static void fwtty_send_xchar(struct tty
  {
        struct fwtty_port *port = tty->driver_data;
  
 -      fwtty_dbg(port, "%02x", ch);
 +      fwtty_dbg(port, "%02x\n", ch);
  
        fwtty_write_xchar(port, ch);
  }
@@@ -1260,7 -1254,7 +1260,7 @@@ static void fwtty_unthrottle(struct tty
  {
        struct fwtty_port *port = tty->driver_data;
  
 -      fwtty_dbg(port, "CRTSCTS: %d", (C_CRTSCTS(tty) != 0));
 +      fwtty_dbg(port, "CRTSCTS: %d\n", (C_CRTSCTS(tty) != 0));
  
        profile_fifo_avail(port, port->stats.unthrottle);
  
@@@ -1415,7 -1409,7 +1415,7 @@@ static int fwtty_break_ctl(struct tty_s
        struct fwtty_port *port = tty->driver_data;
        long ret;
  
 -      fwtty_dbg(port, "%d", state);
 +      fwtty_dbg(port, "%d\n", state);
  
        if (state == -1) {
                set_bit(STOP_TX, &port->flags);
@@@ -1452,7 -1446,7 +1452,7 @@@ static int fwtty_tiocmget(struct tty_st
        tiocm = (port->mctrl & MCTRL_MASK) | (port->mstatus & ~MCTRL_MASK);
        spin_unlock_bh(&port->lock);
  
 -      fwtty_dbg(port, "%x", tiocm);
 +      fwtty_dbg(port, "%x\n", tiocm);
  
        return tiocm;
  }
@@@ -1461,7 -1455,7 +1461,7 @@@ static int fwtty_tiocmset(struct tty_st
  {
        struct fwtty_port *port = tty->driver_data;
  
 -      fwtty_dbg(port, "set: %x clear: %x", set, clear);
 +      fwtty_dbg(port, "set: %x clear: %x\n", set, clear);
  
        /* TODO: simulate loopback if TIOCM_LOOP set */
  
@@@ -1781,7 -1775,7 +1781,7 @@@ static void fwserial_virt_plug_complete
        if (port->port.console && port->fwcon_ops->notify != NULL)
                (*port->fwcon_ops->notify)(FWCON_NOTIFY_ATTACH, port->con_data);
  
 -      fwtty_info(&peer->unit, "peer (guid:%016llx) connected on %s",
 +      fwtty_info(&peer->unit, "peer (guid:%016llx) connected on %s\n",
                   (unsigned long long)peer->guid, dev_name(port->device));
  }
  
@@@ -1803,7 -1797,7 +1803,7 @@@ static inline int fwserial_send_mgmt_sy
                                           pkt, be16_to_cpu(pkt->hdr.len));
                if (rcode == RCODE_BUSY || rcode == RCODE_SEND_ERROR ||
                    rcode == RCODE_GENERATION) {
 -                      fwtty_dbg(&peer->unit, "mgmt write error: %d", rcode);
 +                      fwtty_dbg(&peer->unit, "mgmt write error: %d\n", rcode);
                        continue;
                } else
                        break;
@@@ -1924,7 -1918,7 +1924,7 @@@ static int fwserial_connect_peer(struc
  
        port = fwserial_find_port(peer);
        if (!port) {
 -              fwtty_err(&peer->unit, "avail ports in use");
 +              fwtty_err(&peer->unit, "avail ports in use\n");
                err = -EBUSY;
                goto free_pkt;
        }
@@@ -2062,7 -2056,7 +2062,7 @@@ static struct fwtty_peer *__fwserial_pe
                 * has created its remote unit device before this driver has
                 * been probed for any unit devices...
                 */
 -              fwtty_err(card, "unknown card (guid %016llx)",
 +              fwtty_err(card, "unknown card (guid %016llx)\n",
                          (unsigned long long) card->guid);
                return NULL;
        }
@@@ -2090,8 -2084,8 +2090,8 @@@ static void __dump_peer_list(struct fw_
        list_for_each_entry_rcu(peer, &serial->peer_list, list) {
                int g = peer->generation;
                smp_rmb();
 -              fwtty_dbg(card, "peer(%d:%x) guid: %016llx\n", g,
 -                        peer->node_id, (unsigned long long) peer->guid);
 +              fwtty_dbg(card, "peer(%d:%x) guid: %016llx\n",
 +                        g, peer->node_id, (unsigned long long) peer->guid);
        }
  }
  #else
@@@ -2179,7 -2173,7 +2179,7 @@@ static int fwserial_add_peer(struct fw_
        peer->serial = serial;
        list_add_rcu(&peer->list, &serial->peer_list);
  
 -      fwtty_info(&peer->unit, "peer added (guid:%016llx)",
 +      fwtty_info(&peer->unit, "peer added (guid:%016llx)\n",
                   (unsigned long long)peer->guid);
  
        /* identify the local unit & virt cable to loopback port */
@@@ -2242,7 -2236,7 +2242,7 @@@ static void fwserial_remove_peer(struc
  
        list_del_rcu(&peer->list);
  
 -      fwtty_info(&peer->unit, "peer removed (guid:%016llx)",
 +      fwtty_info(&peer->unit, "peer removed (guid:%016llx)\n",
                   (unsigned long long)peer->guid);
  
        spin_unlock_bh(&peer->lock);
@@@ -2330,7 -2324,7 +2330,7 @@@ static int fwserial_create(struct fw_un
  
        err = fwtty_ports_add(serial);
        if (err) {
 -              fwtty_err(&unit, "no space in port table");
 +              fwtty_err(&unit, "no space in port table\n");
                goto free_ports;
        }
  
                                                   card->device);
                if (IS_ERR(tty_dev)) {
                        err = PTR_ERR(tty_dev);
 -                      fwtty_err(&unit, "register tty device error (%d)", err);
 +                      fwtty_err(&unit, "register tty device error (%d)\n",
 +                                err);
                        goto unregister_ttys;
                }
  
                                                    card->device);
                if (IS_ERR(loop_dev)) {
                        err = PTR_ERR(loop_dev);
 -                      fwtty_err(&unit, "create loop device failed (%d)", err);
 +                      fwtty_err(&unit, "create loop device failed (%d)\n",
 +                                err);
                        goto unregister_ttys;
                }
                serial->ports[j]->device = loop_dev;
  
        list_add_rcu(&serial->list, &fwserial_list);
  
 -      fwtty_notice(&unit, "TTY over FireWire on device %s (guid %016llx)",
 +      fwtty_notice(&unit, "TTY over FireWire on device %s (guid %016llx)\n",
                     dev_name(card->device), (unsigned long long) card->guid);
  
        err = fwserial_add_peer(serial, unit);
        if (!err)
                return 0;
  
 -      fwtty_err(&unit, "unable to add peer unit device (%d)", err);
 +      fwtty_err(&unit, "unable to add peer unit device (%d)\n", err);
  
        /* fall-through to error processing */
        debugfs_remove_recursive(serial->debugfs);
@@@ -2446,9 -2438,9 +2446,9 @@@ free_ports
   * last peer for a given fw_card triggering the destruction of the same
   * fw_serial for the same fw_card.
   */
- static int fwserial_probe(struct device *dev)
+ static int fwserial_probe(struct fw_unit *unit,
+                         const struct ieee1394_device_id *id)
  {
-       struct fw_unit *unit = fw_unit(dev);
        struct fw_serial *serial;
        int err;
  
   * specific fw_card). If this is the last peer being removed, then trigger
   * the destruction of the underlying TTYs.
   */
- static int fwserial_remove(struct device *dev)
+ static void fwserial_remove(struct fw_unit *unit)
  {
-       struct fwtty_peer *peer = dev_get_drvdata(dev);
+       struct fwtty_peer *peer = dev_get_drvdata(&unit->device);
        struct fw_serial *serial = peer->serial;
        int i;
  
                kref_put(&serial->kref, fwserial_destroy);
        }
        mutex_unlock(&fwserial_list_mutex);
-       return 0;
  }
  
  /**
@@@ -2538,10 -2528,10 +2536,10 @@@ static struct fw_driver fwserial_drive
                .owner  = THIS_MODULE,
                .name   = KBUILD_MODNAME,
                .bus    = &fw_bus_type,
-               .probe  = fwserial_probe,
-               .remove = fwserial_remove,
        },
+       .probe    = fwserial_probe,
        .update   = fwserial_update,
+       .remove   = fwserial_remove,
        .id_table = fwserial_id_table,
  };
  
@@@ -2629,7 -2619,7 +2627,7 @@@ static void fwserial_handle_plug_req(st
        switch (peer->state) {
        case FWPS_NOT_ATTACHED:
                if (!port) {
 -                      fwtty_err(&peer->unit, "no more ports avail");
 +                      fwtty_err(&peer->unit, "no more ports avail\n");
                        fill_plug_rsp_nack(pkt);
                } else {
                        peer->port = port;
                        fwtty_write_port_status(tmp);
                        spin_lock_bh(&peer->lock);
                } else {
 -                      fwtty_err(&peer->unit, "PLUG_RSP error (%d)", rcode);
 +                      fwtty_err(&peer->unit, "PLUG_RSP error (%d)\n", rcode);
                        port = peer_revert_state(peer);
                }
        }
@@@ -2723,8 -2713,7 +2721,8 @@@ static void fwserial_handle_unplug_req(
        spin_lock_bh(&peer->lock);
        if (peer->state == FWPS_UNPLUG_RESPONDING) {
                if (rcode != RCODE_COMPLETE)
 -                      fwtty_err(&peer->unit, "UNPLUG_RSP error (%d)", rcode);
 +                      fwtty_err(&peer->unit, "UNPLUG_RSP error (%d)\n",
 +                                rcode);
                port = peer_revert_state(peer);
        }
  cleanup:
@@@ -2759,19 -2748,19 +2757,19 @@@ static int fwserial_parse_mgmt_write(st
                 * already removed from the bus -- and the removal was
                 * processed before we rec'd this transaction
                 */
 -              fwtty_err(&peer->unit, "peer already removed");
 +              fwtty_err(&peer->unit, "peer already removed\n");
                spin_unlock_bh(&peer->lock);
                return RCODE_ADDRESS_ERROR;
        }
  
        rcode = RCODE_COMPLETE;
  
 -      fwtty_dbg(&peer->unit, "mgmt: hdr.code: %04hx", pkt->hdr.code);
 +      fwtty_dbg(&peer->unit, "mgmt: hdr.code: %04hx\n", pkt->hdr.code);
  
        switch (be16_to_cpu(pkt->hdr.code) & FWSC_CODE_MASK) {
        case FWSC_VIRT_CABLE_PLUG:
                if (work_pending(&peer->work)) {
 -                      fwtty_err(&peer->unit, "plug req: busy");
 +                      fwtty_err(&peer->unit, "plug req: busy\n");
                        rcode = RCODE_CONFLICT_ERROR;
  
                } else {
                        rcode = RCODE_CONFLICT_ERROR;
  
                } else if (be16_to_cpu(pkt->hdr.code) & FWSC_RSP_NACK) {
 -                      fwtty_notice(&peer->unit, "NACK plug rsp");
 +                      fwtty_notice(&peer->unit, "NACK plug rsp\n");
                        port = peer_revert_state(peer);
  
                } else {
  
        case FWSC_VIRT_CABLE_UNPLUG:
                if (work_pending(&peer->work)) {
 -                      fwtty_err(&peer->unit, "unplug req: busy");
 +                      fwtty_err(&peer->unit, "unplug req: busy\n");
                        rcode = RCODE_CONFLICT_ERROR;
                } else {
                        PREPARE_WORK(&peer->work, fwserial_handle_unplug_req);
                        rcode = RCODE_CONFLICT_ERROR;
                else {
                        if (be16_to_cpu(pkt->hdr.code) & FWSC_RSP_NACK)
 -                              fwtty_notice(&peer->unit, "NACK unplug?");
 +                              fwtty_notice(&peer->unit, "NACK unplug?\n");
                        port = peer_revert_state(peer);
                        reset = true;
                }
                break;
  
        default:
 -              fwtty_err(&peer->unit, "unknown mgmt code %d",
 +              fwtty_err(&peer->unit, "unknown mgmt code %d\n",
                          be16_to_cpu(pkt->hdr.code));
                rcode = RCODE_DATA_ERROR;
        }
@@@ -2856,7 -2845,7 +2854,7 @@@ static void fwserial_mgmt_handler(struc
        rcu_read_lock();
        peer = __fwserial_peer_by_node_id(card, generation, source);
        if (!peer) {
 -              fwtty_dbg(card, "peer(%d:%x) not found", generation, source);
 +              fwtty_dbg(card, "peer(%d:%x) not found\n", generation, source);
                __dump_peer_list(card);
                rcode = RCODE_CONFLICT_ERROR;
  
@@@ -2906,7 -2895,7 +2904,7 @@@ static int __init fwserial_init(void
  
        err = tty_register_driver(fwtty_driver);
        if (err) {
 -              driver_err("register tty driver failed (%d)", err);
 +              pr_err("register tty driver failed (%d)\n", err);
                goto put_tty;
        }
  
  
                err = tty_register_driver(fwloop_driver);
                if (err) {
 -                      driver_err("register loop driver failed (%d)", err);
 +                      pr_err("register loop driver failed (%d)\n", err);
                        goto put_loop;
                }
        }
        err = fw_core_add_address_handler(&fwserial_mgmt_addr_handler,
                                          &fwserial_mgmt_addr_region);
        if (err) {
 -              driver_err("add management handler failed (%d)", err);
 +              pr_err("add management handler failed (%d)\n", err);
                goto destroy_cache;
        }
  
                FW_UNIT_ADDRESS(fwserial_mgmt_addr_handler.offset);
        err = fw_core_add_descriptor(&fwserial_unit_directory);
        if (err) {
 -              driver_err("add unit descriptor failed (%d)", err);
 +              pr_err("add unit descriptor failed (%d)\n", err);
                goto remove_handler;
        }
  
        err = driver_register(&fwserial_driver.driver);
        if (err) {
 -              driver_err("register fwserial driver failed (%d)", err);
 +              pr_err("register fwserial driver failed (%d)\n", err);
                goto remove_descriptor;
        }
  
diff --combined sound/firewire/scs1x.c
index b252c21b6d13b32d1fbc16a4d9894b6995d2dbf0,1f5920d6eacc02ec84a1795543799a3aaba77fbe..505fc812319958e12e804a2917c6d6cd3b4df88d
@@@ -384,9 -384,8 +384,8 @@@ static void scs_card_free(struct snd_ca
        kfree(scs->buffer);
  }
  
- static int scs_probe(struct device *unit_dev)
+ static int scs_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
  {
-       struct fw_unit *unit = fw_unit(unit_dev);
        struct fw_device *fw_dev = fw_parent_device(unit);
        struct snd_card *card;
        struct scs *scs;
        err = snd_card_create(-16, NULL, THIS_MODULE, sizeof(*scs), &card);
        if (err < 0)
                return err;
-       snd_card_set_dev(card, unit_dev);
+       snd_card_set_dev(card, &unit->device);
  
        scs = card->private_data;
        scs->card = card;
        scs->output_idle = true;
  
        scs->buffer = kmalloc(HSS1394_MAX_PACKET_SIZE, GFP_KERNEL);
 -      if (!scs->buffer)
 +      if (!scs->buffer) {
 +              err = -ENOMEM;
                goto err_card;
 +      }
  
        scs->hss_handler.length = HSS1394_MAX_PACKET_SIZE;
        scs->hss_handler.address_callback = handle_hss;
        if (err < 0)
                goto err_card;
  
-       dev_set_drvdata(unit_dev, scs);
+       dev_set_drvdata(&unit->device, scs);
  
        return 0;
  
@@@ -453,9 -450,20 +452,20 @@@ err_card
        return err;
  }
  
- static int scs_remove(struct device *dev)
+ static void scs_update(struct fw_unit *unit)
  {
-       struct scs *scs = dev_get_drvdata(dev);
+       struct scs *scs = dev_get_drvdata(&unit->device);
+       __be64 data;
+       data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) |
+                          scs->hss_handler.offset);
+       snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST,
+                          HSS1394_ADDRESS, &data, 8);
+ }
+ static void scs_remove(struct fw_unit *unit)
+ {
+       struct scs *scs = dev_get_drvdata(&unit->device);
  
        snd_card_disconnect(scs->card);
  
        tasklet_kill(&scs->tasklet);
  
        snd_card_free_when_closed(scs->card);
-       return 0;
- }
- static void scs_update(struct fw_unit *unit)
- {
-       struct scs *scs = dev_get_drvdata(&unit->device);
-       __be64 data;
-       data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) |
-                          scs->hss_handler.offset);
-       snd_fw_transaction(scs->unit, TCODE_WRITE_BLOCK_REQUEST,
-                          HSS1394_ADDRESS, &data, 8);
  }
  
  static const struct ieee1394_device_id scs_id_table[] = {
@@@ -508,10 -503,10 +505,10 @@@ static struct fw_driver scs_driver = 
                .owner  = THIS_MODULE,
                .name   = KBUILD_MODNAME,
                .bus    = &fw_bus_type,
-               .probe  = scs_probe,
-               .remove = scs_remove,
        },
+       .probe    = scs_probe,
        .update   = scs_update,
+       .remove   = scs_remove,
        .id_table = scs_id_table,
  };