staging: kpc2000: added a helper to get struct kp2000_device from struct device.
The attribute call-backs all use the same formula to get the pcard from
dev:
struct pci_dev *pdev = to_pci_dev(dev);
struct kp2000_device *pcard;
if (!pdev)
return -ENXIO;
pcard = pci_get_drvdata(pdev);
if (!pcard)
return -ENXIO;
Added a function to reduce the duplicated code.
Signed-off-by:
Jeremy Sowden <jeremy@azazel.net>
Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
Please sign in to comment