Commit 083c2048 authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman

staging: sm750fb: use sm750_dev with pci_{get, set}_drvdata

Use sm750_dev as private driver data for the PCI device
Signed-off-by: default avatarMike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4fd92f51
...@@ -395,6 +395,7 @@ static inline unsigned int chan_to_field(unsigned int chan, ...@@ -395,6 +395,7 @@ static inline unsigned int chan_to_field(unsigned int chan,
static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg) static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
{ {
struct fb_info *info; struct fb_info *info;
struct sm750_dev *sm750_dev;
struct lynx_share *share; struct lynx_share *share;
int ret; int ret;
...@@ -402,7 +403,8 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg) ...@@ -402,7 +403,8 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
return 0; return 0;
ret = 0; ret = 0;
share = pci_get_drvdata(pdev); sm750_dev = pci_get_drvdata(pdev);
share = &sm750_dev->share;
switch (mesg.event) { switch (mesg.event) {
case PM_EVENT_FREEZE: case PM_EVENT_FREEZE:
case PM_EVENT_PRETHAW: case PM_EVENT_PRETHAW:
...@@ -453,8 +455,8 @@ static int lynxfb_resume(struct pci_dev *pdev) ...@@ -453,8 +455,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
int ret; int ret;
ret = 0; ret = 0;
share = pci_get_drvdata(pdev); sm750_dev = pci_get_drvdata(pdev);
sm750_dev = container_of(share, struct sm750_dev, share); share = &sm750_dev->share;
console_lock(); console_lock();
...@@ -1103,7 +1105,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, ...@@ -1103,7 +1105,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
pr_info("sm%3x mmio address = %p\n", share->devid, share->pvReg); pr_info("sm%3x mmio address = %p\n", share->devid, share->pvReg);
pci_set_drvdata(pdev, share); pci_set_drvdata(pdev, sm750_dev);
/* call chipInit routine */ /* call chipInit routine */
hw_sm750_inithw(sm750_dev, pdev); hw_sm750_inithw(sm750_dev, pdev);
...@@ -1183,7 +1185,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev) ...@@ -1183,7 +1185,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
int cnt; int cnt;
cnt = 2; cnt = 2;
share = pci_get_drvdata(pdev); sm750_dev = pci_get_drvdata(pdev);
share = &sm750_dev->share;
while (cnt-- > 0) { while (cnt-- > 0) {
info = share->fbinfo[cnt]; info = share->fbinfo[cnt];
...@@ -1199,7 +1202,6 @@ static void lynxfb_pci_remove(struct pci_dev *pdev) ...@@ -1199,7 +1202,6 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
iounmap(share->pvReg); iounmap(share->pvReg);
iounmap(share->pvMem); iounmap(share->pvMem);
sm750_dev = container_of(share, struct sm750_dev, share);
kfree(g_settings); kfree(g_settings);
kfree(sm750_dev); kfree(sm750_dev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment