File tree Expand file tree Collapse file tree 4 files changed +5
-16
lines changed Expand file tree Collapse file tree 4 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,8 @@ static int sdw_drv_probe(struct device *dev)
126
126
if (slave -> prop .use_domain_irq )
127
127
sdw_irq_create_mapping (slave );
128
128
129
- /* init the sysfs as we have properties now */
130
- ret = sdw_slave_sysfs_init (slave );
129
+ /* init the dynamic sysfs attributes we need */
130
+ ret = sdw_slave_sysfs_dpn_init (slave );
131
131
if (ret < 0 )
132
132
dev_warn (dev , "Slave sysfs init failed:%d\n" , ret );
133
133
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ extern const struct attribute_group *sdw_slave_status_attr_groups[];
15
15
extern const struct attribute_group * sdw_attr_groups [];
16
16
17
17
/* additional device-managed properties reported after driver probe */
18
- int sdw_slave_sysfs_init (struct sdw_slave * slave );
19
18
int sdw_slave_sysfs_dpn_init (struct sdw_slave * slave );
20
19
21
20
#endif /* __SDW_SYSFS_LOCAL_H */
Original file line number Diff line number Diff line change @@ -221,19 +221,6 @@ const struct attribute_group *sdw_attr_groups[] = {
221
221
NULL ,
222
222
};
223
223
224
- int sdw_slave_sysfs_init (struct sdw_slave * slave )
225
- {
226
- int ret ;
227
-
228
- if (slave -> prop .source_ports || slave -> prop .sink_ports ) {
229
- ret = sdw_slave_sysfs_dpn_init (slave );
230
- if (ret < 0 )
231
- return ret ;
232
- }
233
-
234
- return 0 ;
235
- }
236
-
237
224
/*
238
225
* the status is shown in capital letters for UNATTACHED and RESERVED
239
226
* on purpose, to highligh users to the fact that these status values
Original file line number Diff line number Diff line change @@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave)
283
283
int ret ;
284
284
int i ;
285
285
286
+ if (!slave -> prop .source_ports && !slave -> prop .sink_ports )
287
+ return 0 ;
288
+
286
289
mask = slave -> prop .source_ports ;
287
290
for_each_set_bit (i , & mask , 32 ) {
288
291
ret = add_all_attributes (& slave -> dev , i , 1 );
You can’t perform that action at this time.
0 commit comments