aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-29 08:20:14 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-17 11:04:48 -0400
commit7f67d96ab181aff4af2074ba0a56b3f81333e896 (patch)
tree376662efe8440d6d4a282dbed9c37d6d1021a022 /drivers/media/usb
parent4647f487083ded0d42a61bf2e066ce5328624ed3 (diff)
[media] dib7000p: rename dib7000p_attach to dib7000p_init
Well, what we call as "foo_attach" is the method that should be called by the dvb_attach() macro. It should be noticed that the name "dvb_attach" is really a bad name and don't express what it does. dvb_attach() basically does three things, if the frontend is compiled as a module: - It lookups for the module that it is known to have the given symbol name and requests such module; - It increments the module usage (anonymously - so lsmod doesn't print who loaded the module); - after loading the module, it runs the function associated with the dynamic symbol. When compiled as builtin, it just calls the function given to it. As dvb_attach() increments refcount, it can't be (easily) called more than once for the same module, or the kernel will deny to remove the module, because refcount will never be zeroed. In other words, the function name given to dvb_attach() should be one single symbol that will always be called before any other function on that module to be used. For almost all DVB frontends, there's just one function. However, the dib7000p initialization can require up to 3 functions to be called: - dib7000p_get_i2c_master; - dib7000p_i2c_enumeration; - dib7000p_init (before this patch dib7000_attach). (plus a bunch of other functions that the bridge driver will need to call). As we need to get rid of all those direct calls, because they cause compilation breakages when bridge is builtin and frontend is module, we'll need to add a new function that will be the first one to be called, whatever initialization is needed. So, let's rename the function that probes and init the hardware to dib7000p_init. A latter patch will add a new dib7000p_attach that will be used as originally conceived by dvb_attach() way. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb/cxusb.c2
-rw-r--r--drivers/media/usb/dvb-usb/dib0700_devices.c28
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
index a1c641e18362..e81a2fd54960 100644
--- a/drivers/media/usb/dvb-usb/cxusb.c
+++ b/drivers/media/usb/dvb-usb/cxusb.c
@@ -1085,7 +1085,7 @@ static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap)
1085 return -ENODEV; 1085 return -ENODEV;
1086 } 1086 }
1087 1087
1088 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, 1088 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80,
1089 &cxusb_dualdig4_rev2_config); 1089 &cxusb_dualdig4_rev2_config);
1090 if (adap->fe_adap[0].fe == NULL) 1090 if (adap->fe_adap[0].fe == NULL)
1091 return -EIO; 1091 return -EIO;
diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c
index 10e0db8d1850..3585089c805c 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -281,7 +281,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
281 } 281 }
282 282
283 adap->fe_adap[0].fe = 283 adap->fe_adap[0].fe =
284 dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 284 dvb_attach(dib7000p_init, &adap->dev->i2c_adap,
285 0x80 + (adap->id << 1), 285 0x80 + (adap->id << 1),
286 &stk7700d_dib7000p_mt2266_config[adap->id]); 286 &stk7700d_dib7000p_mt2266_config[adap->id]);
287 287
@@ -310,7 +310,7 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
310 } 310 }
311 311
312 adap->fe_adap[0].fe = 312 adap->fe_adap[0].fe =
313 dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 313 dvb_attach(dib7000p_init, &adap->dev->i2c_adap,
314 0x80 + (adap->id << 1), 314 0x80 + (adap->id << 1),
315 &stk7700d_dib7000p_mt2266_config[adap->id]); 315 &stk7700d_dib7000p_mt2266_config[adap->id]);
316 316
@@ -452,7 +452,7 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
452 return -ENODEV; 452 return -ENODEV;
453 } 453 }
454 454
455 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, 455 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80,
456 &stk7700ph_dib7700_xc3028_config); 456 &stk7700ph_dib7700_xc3028_config);
457 457
458 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 458 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
@@ -690,7 +690,7 @@ static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
690 st->mt2060_if1[0] = 1220; 690 st->mt2060_if1[0] = 1220;
691 691
692 if (dib7000pc_detection(&adap->dev->i2c_adap)) { 692 if (dib7000pc_detection(&adap->dev->i2c_adap)) {
693 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); 693 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
694 st->is_dib7000pc = 1; 694 st->is_dib7000pc = 1;
695 } else 695 } else
696 adap->fe_adap[0].fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); 696 adap->fe_adap[0].fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
@@ -961,7 +961,7 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
961 return -ENODEV; 961 return -ENODEV;
962 } 962 }
963 963
964 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, 964 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80,
965 &dib7070p_dib7000p_config); 965 &dib7070p_dib7000p_config);
966 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 966 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
967} 967}
@@ -1013,7 +1013,7 @@ static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
1013 return -ENODEV; 1013 return -ENODEV;
1014 } 1014 }
1015 1015
1016 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, 1016 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80,
1017 &dib7770p_dib7000p_config); 1017 &dib7770p_dib7000p_config);
1018 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 1018 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
1019} 1019}
@@ -2899,7 +2899,7 @@ static int nim7090_frontend_attach(struct dvb_usb_adapter *adap)
2899 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); 2899 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__);
2900 return -ENODEV; 2900 return -ENODEV;
2901 } 2901 }
2902 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config); 2902 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config);
2903 2903
2904 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 2904 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
2905} 2905}
@@ -2945,7 +2945,7 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap)
2945 } 2945 }
2946 2946
2947 dib0700_set_i2c_speed(adap->dev, 340); 2947 dib0700_set_i2c_speed(adap->dev, 340);
2948 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]); 2948 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]);
2949 if (adap->fe_adap[0].fe == NULL) 2949 if (adap->fe_adap[0].fe == NULL)
2950 return -ENODEV; 2950 return -ENODEV;
2951 2951
@@ -2969,7 +2969,7 @@ static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap)
2969 return -ENODEV; 2969 return -ENODEV;
2970 } 2970 }
2971 2971
2972 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, i2c, 0x92, &tfe7090pvr_dib7000p_config[1]); 2972 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, i2c, 0x92, &tfe7090pvr_dib7000p_config[1]);
2973 dib0700_set_i2c_speed(adap->dev, 200); 2973 dib0700_set_i2c_speed(adap->dev, 200);
2974 2974
2975 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 2975 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
@@ -3030,7 +3030,7 @@ static int tfe7790p_frontend_attach(struct dvb_usb_adapter *adap)
3030 __func__); 3030 __func__);
3031 return -ENODEV; 3031 return -ENODEV;
3032 } 3032 }
3033 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 3033 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap,
3034 0x80, &tfe7790p_dib7000p_config); 3034 0x80, &tfe7790p_dib7000p_config);
3035 3035
3036 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 3036 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
@@ -3115,13 +3115,13 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
3115 return -ENODEV; 3115 return -ENODEV;
3116 } 3116 }
3117 3117
3118 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); 3118 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
3119 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 3119 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
3120} 3120}
3121 3121
3122static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) 3122static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
3123{ 3123{
3124 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); 3124 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
3125 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; 3125 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
3126} 3126}
3127 3127
@@ -3181,7 +3181,7 @@ static int novatd_frontend_attach(struct dvb_usb_adapter *adap)
3181 } 3181 }
3182 } 3182 }
3183 3183
3184 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &dev->i2c_adap, 3184 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &dev->i2c_adap,
3185 adap->id == 0 ? 0x80 : 0x82, 3185 adap->id == 0 ? 0x80 : 0x82,
3186 &stk7070pd_dib7000p_config[adap->id]); 3186 &stk7070pd_dib7000p_config[adap->id]);
3187 3187
@@ -3402,7 +3402,7 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap)
3402 return -ENODEV; 3402 return -ENODEV;
3403 } 3403 }
3404 3404
3405 adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x12, 3405 adap->fe_adap[0].fe = dvb_attach(dib7000p_init, &adap->dev->i2c_adap, 0x12,
3406 &pctv_340e_config); 3406 &pctv_340e_config);
3407 st->is_dib7000pc = 1; 3407 st->is_dib7000pc = 1;
3408 3408