* SysFS Attributes
******************************************************/
-static struct kp2000_device *get_pcard(struct device *dev)
-{
- struct pci_dev *pdev = to_pci_dev(dev);
-
- if (!pdev)
- return NULL;
-
- return pci_get_drvdata(pdev);
-}
-
static ssize_t ssid_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t ddna_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t card_id_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t hw_rev_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t build_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t build_date_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t build_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
if (!pcard)
return -ENXIO;
static ssize_t cpld_reg_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
u64 val;
if (!pcard)
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct kp2000_device *pcard = get_pcard(dev);
+ struct kp2000_device *pcard = dev_get_drvdata(dev);
long wr_val;
int rv;