@@ -61,27 +61,27 @@ const struct dsa_device_ops *dsa_device_ops[DSA_TAG_LAST] = {
6161static DEFINE_MUTEX (dsa_switch_drivers_mutex );
6262static LIST_HEAD (dsa_switch_drivers );
6363
64- void register_switch_driver (struct dsa_switch_driver * drv )
64+ void register_switch_driver (struct dsa_switch_ops * ops )
6565{
6666 mutex_lock (& dsa_switch_drivers_mutex );
67- list_add_tail (& drv -> list , & dsa_switch_drivers );
67+ list_add_tail (& ops -> list , & dsa_switch_drivers );
6868 mutex_unlock (& dsa_switch_drivers_mutex );
6969}
7070EXPORT_SYMBOL_GPL (register_switch_driver );
7171
72- void unregister_switch_driver (struct dsa_switch_driver * drv )
72+ void unregister_switch_driver (struct dsa_switch_ops * ops )
7373{
7474 mutex_lock (& dsa_switch_drivers_mutex );
75- list_del_init (& drv -> list );
75+ list_del_init (& ops -> list );
7676 mutex_unlock (& dsa_switch_drivers_mutex );
7777}
7878EXPORT_SYMBOL_GPL (unregister_switch_driver );
7979
80- static struct dsa_switch_driver *
80+ static struct dsa_switch_ops *
8181dsa_switch_probe (struct device * parent , struct device * host_dev , int sw_addr ,
8282 const char * * _name , void * * priv )
8383{
84- struct dsa_switch_driver * ret ;
84+ struct dsa_switch_ops * ret ;
8585 struct list_head * list ;
8686 const char * name ;
8787
@@ -90,13 +90,13 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
9090
9191 mutex_lock (& dsa_switch_drivers_mutex );
9292 list_for_each (list , & dsa_switch_drivers ) {
93- struct dsa_switch_driver * drv ;
93+ struct dsa_switch_ops * ops ;
9494
95- drv = list_entry (list , struct dsa_switch_driver , list );
95+ ops = list_entry (list , struct dsa_switch_ops , list );
9696
97- name = drv -> probe (parent , host_dev , sw_addr , priv );
97+ name = ops -> probe (parent , host_dev , sw_addr , priv );
9898 if (name != NULL ) {
99- ret = drv ;
99+ ret = ops ;
100100 break ;
101101 }
102102 }
@@ -117,7 +117,7 @@ static ssize_t temp1_input_show(struct device *dev,
117117 struct dsa_switch * ds = dev_get_drvdata (dev );
118118 int temp , ret ;
119119
120- ret = ds -> drv -> get_temp (ds , & temp );
120+ ret = ds -> ops -> get_temp (ds , & temp );
121121 if (ret < 0 )
122122 return ret ;
123123
@@ -131,7 +131,7 @@ static ssize_t temp1_max_show(struct device *dev,
131131 struct dsa_switch * ds = dev_get_drvdata (dev );
132132 int temp , ret ;
133133
134- ret = ds -> drv -> get_temp_limit (ds , & temp );
134+ ret = ds -> ops -> get_temp_limit (ds , & temp );
135135 if (ret < 0 )
136136 return ret ;
137137
@@ -149,7 +149,7 @@ static ssize_t temp1_max_store(struct device *dev,
149149 if (ret < 0 )
150150 return ret ;
151151
152- ret = ds -> drv -> set_temp_limit (ds , DIV_ROUND_CLOSEST (temp , 1000 ));
152+ ret = ds -> ops -> set_temp_limit (ds , DIV_ROUND_CLOSEST (temp , 1000 ));
153153 if (ret < 0 )
154154 return ret ;
155155
@@ -164,7 +164,7 @@ static ssize_t temp1_max_alarm_show(struct device *dev,
164164 bool alarm ;
165165 int ret ;
166166
167- ret = ds -> drv -> get_temp_alarm (ds , & alarm );
167+ ret = ds -> ops -> get_temp_alarm (ds , & alarm );
168168 if (ret < 0 )
169169 return ret ;
170170
@@ -184,15 +184,15 @@ static umode_t dsa_hwmon_attrs_visible(struct kobject *kobj,
184184{
185185 struct device * dev = container_of (kobj , struct device , kobj );
186186 struct dsa_switch * ds = dev_get_drvdata (dev );
187- struct dsa_switch_driver * drv = ds -> drv ;
187+ struct dsa_switch_ops * ops = ds -> ops ;
188188 umode_t mode = attr -> mode ;
189189
190190 if (index == 1 ) {
191- if (!drv -> get_temp_limit )
191+ if (!ops -> get_temp_limit )
192192 mode = 0 ;
193- else if (!drv -> set_temp_limit )
193+ else if (!ops -> set_temp_limit )
194194 mode &= ~S_IWUSR ;
195- } else if (index == 2 && !drv -> get_temp_alarm ) {
195+ } else if (index == 2 && !ops -> get_temp_alarm ) {
196196 mode = 0 ;
197197 }
198198 return mode ;
@@ -228,8 +228,8 @@ int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,
228228
229229 genphy_config_init (phydev );
230230 genphy_read_status (phydev );
231- if (ds -> drv -> adjust_link )
232- ds -> drv -> adjust_link (ds , port , phydev );
231+ if (ds -> ops -> adjust_link )
232+ ds -> ops -> adjust_link (ds , port , phydev );
233233 }
234234
235235 return 0 ;
@@ -303,7 +303,7 @@ void dsa_cpu_port_ethtool_restore(struct dsa_switch *ds)
303303
304304static int dsa_switch_setup_one (struct dsa_switch * ds , struct device * parent )
305305{
306- struct dsa_switch_driver * drv = ds -> drv ;
306+ struct dsa_switch_ops * ops = ds -> ops ;
307307 struct dsa_switch_tree * dst = ds -> dst ;
308308 struct dsa_chip_data * cd = ds -> cd ;
309309 bool valid_name_found = false;
@@ -356,7 +356,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
356356 if (dst -> cpu_switch == index ) {
357357 enum dsa_tag_protocol tag_protocol ;
358358
359- tag_protocol = drv -> get_tag_protocol (ds );
359+ tag_protocol = ops -> get_tag_protocol (ds );
360360 dst -> tag_ops = dsa_resolve_tag_protocol (tag_protocol );
361361 if (IS_ERR (dst -> tag_ops )) {
362362 ret = PTR_ERR (dst -> tag_ops );
@@ -371,15 +371,15 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
371371 /*
372372 * Do basic register setup.
373373 */
374- ret = drv -> setup (ds );
374+ ret = ops -> setup (ds );
375375 if (ret < 0 )
376376 goto out ;
377377
378- ret = drv -> set_addr (ds , dst -> master_netdev -> dev_addr );
378+ ret = ops -> set_addr (ds , dst -> master_netdev -> dev_addr );
379379 if (ret < 0 )
380380 goto out ;
381381
382- if (!ds -> slave_mii_bus && drv -> phy_read ) {
382+ if (!ds -> slave_mii_bus && ops -> phy_read ) {
383383 ds -> slave_mii_bus = devm_mdiobus_alloc (parent );
384384 if (!ds -> slave_mii_bus ) {
385385 ret = - ENOMEM ;
@@ -426,7 +426,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
426426 * register with hardware monitoring subsystem.
427427 * Treat registration error as non-fatal and ignore it.
428428 */
429- if (drv -> get_temp ) {
429+ if (ops -> get_temp ) {
430430 const char * netname = netdev_name (dst -> master_netdev );
431431 char hname [IFNAMSIZ + 1 ];
432432 int i , j ;
@@ -457,7 +457,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
457457 struct device * parent , struct device * host_dev )
458458{
459459 struct dsa_chip_data * cd = dst -> pd -> chip + index ;
460- struct dsa_switch_driver * drv ;
460+ struct dsa_switch_ops * ops ;
461461 struct dsa_switch * ds ;
462462 int ret ;
463463 const char * name ;
@@ -466,8 +466,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
466466 /*
467467 * Probe for switch model.
468468 */
469- drv = dsa_switch_probe (parent , host_dev , cd -> sw_addr , & name , & priv );
470- if (drv == NULL ) {
469+ ops = dsa_switch_probe (parent , host_dev , cd -> sw_addr , & name , & priv );
470+ if (! ops ) {
471471 netdev_err (dst -> master_netdev , "[%d]: could not detect attached switch\n" ,
472472 index );
473473 return ERR_PTR (- EINVAL );
@@ -486,7 +486,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
486486 ds -> dst = dst ;
487487 ds -> index = index ;
488488 ds -> cd = cd ;
489- ds -> drv = drv ;
489+ ds -> ops = ops ;
490490 ds -> priv = priv ;
491491 ds -> dev = parent ;
492492
@@ -541,7 +541,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
541541 ds -> dsa_port_mask |= ~(1 << port );
542542 }
543543
544- if (ds -> slave_mii_bus && ds -> drv -> phy_read )
544+ if (ds -> slave_mii_bus && ds -> ops -> phy_read )
545545 mdiobus_unregister (ds -> slave_mii_bus );
546546}
547547
@@ -560,8 +560,8 @@ int dsa_switch_suspend(struct dsa_switch *ds)
560560 return ret ;
561561 }
562562
563- if (ds -> drv -> suspend )
564- ret = ds -> drv -> suspend (ds );
563+ if (ds -> ops -> suspend )
564+ ret = ds -> ops -> suspend (ds );
565565
566566 return ret ;
567567}
@@ -571,8 +571,8 @@ int dsa_switch_resume(struct dsa_switch *ds)
571571{
572572 int i , ret = 0 ;
573573
574- if (ds -> drv -> resume )
575- ret = ds -> drv -> resume (ds );
574+ if (ds -> ops -> resume )
575+ ret = ds -> ops -> resume (ds );
576576
577577 if (ret )
578578 return ret ;
0 commit comments