aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-06-15 20:17:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 06:56:34 -0400
commitddee56943ab6df098e411fe943c2a52063fba0a5 (patch)
treedcb848b6fc93284bd4129f148539956c650c5be0 /drivers/media/dvb/dvb-usb
parentdd5e52cdf9e2518e79b634fa2ae1cc86e37cff14 (diff)
[media] dvb_usb_v2: .read_mac_address() callback changes
Give DVB adapter as a parameter for callback. MAC address is adapter property and it could be (at least in theory) there is devices having multiple adapters and all has own MAC. Also add error handling. If callback fails error is returned which leads device unregister. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h2
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb_dvb.c17
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index 6392fd3d4164..e7015ce5b3b4 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -181,7 +181,7 @@ struct dvb_usb_device_properties {
181 181
182 int (*power_ctrl) (struct dvb_usb_device *, int); 182 int (*power_ctrl) (struct dvb_usb_device *, int);
183 int (*read_config) (struct dvb_usb_device *d); 183 int (*read_config) (struct dvb_usb_device *d);
184 int (*read_mac_address) (struct dvb_usb_device *, u8 []); 184 int (*read_mac_address) (struct dvb_usb_adapter *, u8 []);
185 int (*frontend_attach) (struct dvb_usb_adapter *); 185 int (*frontend_attach) (struct dvb_usb_adapter *);
186 int (*tuner_attach) (struct dvb_usb_adapter *); 186 int (*tuner_attach) (struct dvb_usb_adapter *);
187 int (*frontend_ctrl) (struct dvb_frontend *, int); 187 int (*frontend_ctrl) (struct dvb_frontend *, int);
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
index bc94874039e8..3cbae02ea51e 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
@@ -203,22 +203,21 @@ int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap)
203 ret); 203 ret);
204 goto err; 204 goto err;
205 } 205 }
206
206 adap->dvb_adap.priv = adap; 207 adap->dvb_adap.priv = adap;
207 208
208 if (adap->dev->props->read_mac_address) { 209 if (adap->dev->props->read_mac_address) {
209 if (adap->dev->props->read_mac_address(adap->dev, 210 ret = adap->dev->props->read_mac_address(adap,
210 adap->dvb_adap.proposed_mac) == 0) 211 adap->dvb_adap.proposed_mac);
211 pr_info("%s: MAC address: %pM\n", KBUILD_MODNAME, 212 if (ret < 0)
212 adap->dvb_adap.proposed_mac); 213 goto err_dmx;
213 else
214 pr_err("%s: MAC address reading failed\n",
215 KBUILD_MODNAME);
216 }
217 214
215 pr_info("%s: MAC address: %pM\n", KBUILD_MODNAME,
216 adap->dvb_adap.proposed_mac);
217 }
218 218
219 adap->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; 219 adap->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING;
220 adap->demux.priv = adap; 220 adap->demux.priv = adap;
221
222 adap->demux.filternum = 0; 221 adap->demux.filternum = 0;
223 if (adap->demux.filternum < adap->max_feed_count) 222 if (adap->demux.filternum < adap->max_feed_count)
224 adap->demux.filternum = adap->max_feed_count; 223 adap->demux.filternum = adap->max_feed_count;