14
14
* Return: 0 on success, or
15
15
* negative for error
16
16
*/
17
- int pds_client_register (struct pci_dev * pf_pdev , char * devname )
17
+ int pds_client_register (struct pdsc * pf , char * devname )
18
18
{
19
19
union pds_core_adminq_comp comp = {};
20
20
union pds_core_adminq_cmd cmd = {};
21
- struct pdsc * pf ;
22
21
int err ;
23
22
u16 ci ;
24
23
25
- pf = pci_get_drvdata (pf_pdev );
26
- if (pf -> state )
27
- return - ENXIO ;
28
-
29
24
cmd .client_reg .opcode = PDS_AQ_CMD_CLIENT_REG ;
30
25
strscpy (cmd .client_reg .devname , devname ,
31
26
sizeof (cmd .client_reg .devname ));
@@ -59,17 +54,12 @@ EXPORT_SYMBOL_GPL(pds_client_register);
59
54
* Return: 0 on success, or
60
55
* negative for error
61
56
*/
62
- int pds_client_unregister (struct pci_dev * pf_pdev , u16 client_id )
57
+ int pds_client_unregister (struct pdsc * pf , u16 client_id )
63
58
{
64
59
union pds_core_adminq_comp comp = {};
65
60
union pds_core_adminq_cmd cmd = {};
66
- struct pdsc * pf ;
67
61
int err ;
68
62
69
- pf = pci_get_drvdata (pf_pdev );
70
- if (pf -> state )
71
- return - ENXIO ;
72
-
73
63
cmd .client_unreg .opcode = PDS_AQ_CMD_CLIENT_UNREG ;
74
64
cmd .client_unreg .client_id = cpu_to_le16 (client_id );
75
65
@@ -198,7 +188,7 @@ int pdsc_auxbus_dev_del(struct pdsc *cf, struct pdsc *pf)
198
188
199
189
padev = pf -> vfs [cf -> vf_id ].padev ;
200
190
if (padev ) {
201
- pds_client_unregister (pf -> pdev , padev -> client_id );
191
+ pds_client_unregister (pf , padev -> client_id );
202
192
auxiliary_device_delete (& padev -> aux_dev );
203
193
auxiliary_device_uninit (& padev -> aux_dev );
204
194
padev -> client_id = 0 ;
@@ -243,7 +233,7 @@ int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf)
243
233
*/
244
234
snprintf (devname , sizeof (devname ), "%s.%s.%d" ,
245
235
PDS_CORE_DRV_NAME , pf -> viftype_status [vt ].name , cf -> uid );
246
- client_id = pds_client_register (pf -> pdev , devname );
236
+ client_id = pds_client_register (pf , devname );
247
237
if (client_id < 0 ) {
248
238
err = client_id ;
249
239
goto out_unlock ;
@@ -252,7 +242,7 @@ int pdsc_auxbus_dev_add(struct pdsc *cf, struct pdsc *pf)
252
242
padev = pdsc_auxbus_dev_register (cf , pf , client_id ,
253
243
pf -> viftype_status [vt ].name );
254
244
if (IS_ERR (padev )) {
255
- pds_client_unregister (pf -> pdev , client_id );
245
+ pds_client_unregister (pf , client_id );
256
246
err = PTR_ERR (padev );
257
247
goto out_unlock ;
258
248
}
0 commit comments