commit | a986d796395c18e607703af11e1afc1d3a8a5908 | [log] [tgz] |
---|---|---|
author | Jeremy Sowden <jeremy@azazel.net> | Tue May 21 11:35:20 2019 +0100 |
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | Wed May 22 14:44:21 2019 +0200 |
tree | 4d439b5a9ee614a6247b9660a5ad39ff46050fe6 | |
parent | d8ac35939632f25d6b1465a921f8a4d63064e3ae [diff] |
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>