mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
IB/usnic: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make the code simpler. Link: https://lore.kernel.org/r/20190723114928.18424-1-hslester96@gmail.com Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
39289bfc22
commit
4f96061b92
@ -194,7 +194,7 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev,
|
|||||||
return ERR_CAST(dev_list);
|
return ERR_CAST(dev_list);
|
||||||
for (i = 0; dev_list[i]; i++) {
|
for (i = 0; dev_list[i]; i++) {
|
||||||
dev = dev_list[i];
|
dev = dev_list[i];
|
||||||
vf = pci_get_drvdata(to_pci_dev(dev));
|
vf = dev_get_drvdata(dev);
|
||||||
spin_lock(&vf->lock);
|
spin_lock(&vf->lock);
|
||||||
vnic = vf->vnic;
|
vnic = vf->vnic;
|
||||||
if (!usnic_vnic_check_room(vnic, res_spec)) {
|
if (!usnic_vnic_check_room(vnic, res_spec)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user