|
|
@@ -1705,13 +1705,23 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel)
|
|
|
static int
|
|
|
setup_hfcsusb(struct hfcsusb *hw)
|
|
|
{
|
|
|
+ void *dmabuf = kmalloc(sizeof(u_char), GFP_KERNEL);
|
|
|
u_char b;
|
|
|
+ int ret;
|
|
|
|
|
|
if (debug & DBG_HFC_CALL_TRACE)
|
|
|
printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
|
|
|
|
|
|
+ if (!dmabuf)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ ret = read_reg_atomic(hw, HFCUSB_CHIP_ID, dmabuf);
|
|
|
+
|
|
|
+ memcpy(&b, dmabuf, sizeof(u_char));
|
|
|
+ kfree(dmabuf);
|
|
|
+
|
|
|
/* check the chip id */
|
|
|
- if (read_reg_atomic(hw, HFCUSB_CHIP_ID, &b) != 1) {
|
|
|
+ if (ret != 1) {
|
|
|
printk(KERN_DEBUG "%s: %s: cannot read chip id\n",
|
|
|
hw->name, __func__);
|
|
|
return 1;
|