Commit 4df69e46 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: streamzap: remove unused struct members

These struct members do not serve any purpose.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 35088717
...@@ -66,9 +66,6 @@ struct streamzap_ir { ...@@ -66,9 +66,6 @@ struct streamzap_ir {
struct device *dev; struct device *dev;
/* usb */ /* usb */
struct usb_device *usbdev;
struct usb_interface *interface;
struct usb_endpoint_descriptor *endpoint;
struct urb *urb_in; struct urb *urb_in;
/* buffer & dma */ /* buffer & dma */
...@@ -85,7 +82,6 @@ struct streamzap_ir { ...@@ -85,7 +82,6 @@ struct streamzap_ir {
/* start time of signal; necessary for gap tracking */ /* start time of signal; necessary for gap tracking */
ktime_t signal_last; ktime_t signal_last;
ktime_t signal_start; ktime_t signal_start;
bool timeout_enabled;
char phys[64]; char phys[64];
}; };
...@@ -240,7 +236,6 @@ static void streamzap_callback(struct urb *urb) ...@@ -240,7 +236,6 @@ static void streamzap_callback(struct urb *urb)
.duration = sz->rdev->timeout .duration = sz->rdev->timeout
}; };
sz->idle = true; sz->idle = true;
if (sz->timeout_enabled)
sz_push(sz, rawir); sz_push(sz, rawir);
} else { } else {
sz_push_full_space(sz, sz->buf_in[i]); sz_push_full_space(sz, sz->buf_in[i]);
...@@ -263,7 +258,8 @@ static void streamzap_callback(struct urb *urb) ...@@ -263,7 +258,8 @@ static void streamzap_callback(struct urb *urb)
usb_submit_urb(urb, GFP_ATOMIC); usb_submit_urb(urb, GFP_ATOMIC);
} }
static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz) static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz,
struct usb_device *usbdev)
{ {
struct rc_dev *rdev; struct rc_dev *rdev;
struct device *dev = sz->dev; struct device *dev = sz->dev;
...@@ -273,12 +269,12 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz) ...@@ -273,12 +269,12 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz)
if (!rdev) if (!rdev)
goto out; goto out;
usb_make_path(sz->usbdev, sz->phys, sizeof(sz->phys)); usb_make_path(usbdev, sz->phys, sizeof(sz->phys));
strlcat(sz->phys, "/input0", sizeof(sz->phys)); strlcat(sz->phys, "/input0", sizeof(sz->phys));
rdev->device_name = "Streamzap PC Remote Infrared Receiver"; rdev->device_name = "Streamzap PC Remote Infrared Receiver";
rdev->input_phys = sz->phys; rdev->input_phys = sz->phys;
usb_to_input_id(sz->usbdev, &rdev->input_id); usb_to_input_id(usbdev, &rdev->input_id);
rdev->dev.parent = dev; rdev->dev.parent = dev;
rdev->priv = sz; rdev->priv = sz;
rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
...@@ -310,6 +306,7 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -310,6 +306,7 @@ static int streamzap_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct usb_device *usbdev = interface_to_usbdev(intf); struct usb_device *usbdev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *endpoint;
struct usb_host_interface *iface_host; struct usb_host_interface *iface_host;
struct streamzap_ir *sz = NULL; struct streamzap_ir *sz = NULL;
int retval = -ENOMEM; int retval = -ENOMEM;
...@@ -320,9 +317,6 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -320,9 +317,6 @@ static int streamzap_probe(struct usb_interface *intf,
if (!sz) if (!sz)
return -ENOMEM; return -ENOMEM;
sz->usbdev = usbdev;
sz->interface = intf;
/* Check to ensure endpoint information matches requirements */ /* Check to ensure endpoint information matches requirements */
iface_host = intf->cur_altsetting; iface_host = intf->cur_altsetting;
...@@ -333,22 +327,22 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -333,22 +327,22 @@ static int streamzap_probe(struct usb_interface *intf,
goto free_sz; goto free_sz;
} }
sz->endpoint = &(iface_host->endpoint[0].desc); endpoint = &iface_host->endpoint[0].desc;
if (!usb_endpoint_dir_in(sz->endpoint)) { if (!usb_endpoint_dir_in(endpoint)) {
dev_err(&intf->dev, "%s: endpoint doesn't match input device 02%02x\n", dev_err(&intf->dev, "%s: endpoint doesn't match input device 02%02x\n",
__func__, sz->endpoint->bEndpointAddress); __func__, endpoint->bEndpointAddress);
retval = -ENODEV; retval = -ENODEV;
goto free_sz; goto free_sz;
} }
if (!usb_endpoint_xfer_int(sz->endpoint)) { if (!usb_endpoint_xfer_int(endpoint)) {
dev_err(&intf->dev, "%s: endpoint attributes don't match xfer 02%02x\n", dev_err(&intf->dev, "%s: endpoint attributes don't match xfer 02%02x\n",
__func__, sz->endpoint->bmAttributes); __func__, endpoint->bmAttributes);
retval = -ENODEV; retval = -ENODEV;
goto free_sz; goto free_sz;
} }
pipe = usb_rcvintpipe(usbdev, sz->endpoint->bEndpointAddress); pipe = usb_rcvintpipe(usbdev, endpoint->bEndpointAddress);
maxp = usb_maxpacket(usbdev, pipe, usb_pipeout(pipe)); maxp = usb_maxpacket(usbdev, pipe, usb_pipeout(pipe));
if (maxp == 0) { if (maxp == 0) {
...@@ -370,14 +364,13 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -370,14 +364,13 @@ static int streamzap_probe(struct usb_interface *intf,
sz->dev = &intf->dev; sz->dev = &intf->dev;
sz->buf_in_len = maxp; sz->buf_in_len = maxp;
sz->rdev = streamzap_init_rc_dev(sz); sz->rdev = streamzap_init_rc_dev(sz, usbdev);
if (!sz->rdev) if (!sz->rdev)
goto rc_dev_fail; goto rc_dev_fail;
sz->idle = true; sz->idle = true;
sz->decoder_state = PulseSpace; sz->decoder_state = PulseSpace;
/* FIXME: don't yet have a way to set this */ /* FIXME: don't yet have a way to set this */
sz->timeout_enabled = true;
sz->rdev->timeout = SZ_TIMEOUT * SZ_RESOLUTION; sz->rdev->timeout = SZ_TIMEOUT * SZ_RESOLUTION;
#if 0 #if 0
/* not yet supported, depends on patches from maxim */ /* not yet supported, depends on patches from maxim */
...@@ -390,8 +383,7 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -390,8 +383,7 @@ static int streamzap_probe(struct usb_interface *intf,
/* Complete final initialisations */ /* Complete final initialisations */
usb_fill_int_urb(sz->urb_in, usbdev, pipe, sz->buf_in, usb_fill_int_urb(sz->urb_in, usbdev, pipe, sz->buf_in,
maxp, (usb_complete_t)streamzap_callback, maxp, streamzap_callback, sz, endpoint->bInterval);
sz, sz->endpoint->bInterval);
sz->urb_in->transfer_dma = sz->dma_in; sz->urb_in->transfer_dma = sz->dma_in;
sz->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; sz->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
...@@ -432,7 +424,6 @@ static void streamzap_disconnect(struct usb_interface *interface) ...@@ -432,7 +424,6 @@ static void streamzap_disconnect(struct usb_interface *interface)
if (!sz) if (!sz)
return; return;
sz->usbdev = NULL;
rc_unregister_device(sz->rdev); rc_unregister_device(sz->rdev);
usb_kill_urb(sz->urb_in); usb_kill_urb(sz->urb_in);
usb_free_urb(sz->urb_in); usb_free_urb(sz->urb_in);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment