Skip to content

Commit be129fa

Browse files
committed
Merge tag 'for-5.19/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev fixes from Helge Deller: "Two bug fixes for the pxa3xx and intelfb drivers: - pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write - intelfb: Initialize value of stolen size The other changes are small cleanups, simplifications and documentation updates to the cirrusfb, skeletonfb, omapfb, intelfb, au1100fb and simplefb drivers" * tag 'for-5.19/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: video: fbdev: omap: Remove duplicate 'the' in comment video: fbdev: omapfb: Align '*' in comment video: fbdev: simplefb: Check before clk_put() not needed video: fbdev: au1100fb: Drop unnecessary NULL ptr check video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write video: fbdev: skeletonfb: Convert to generic power management video: fbdev: cirrusfb: Remove useless reference to PCI power management video: fbdev: intelfb: Initialize value of stolen size video: fbdev: intelfb: Use aperture size from pci_resource_len video: fbdev: skeletonfb: Fix syntax errors in comments
2 parents c0c6a7b + cb51773 commit be129fa

File tree

9 files changed

+21
-31
lines changed

9 files changed

+21
-31
lines changed

drivers/video/fbdev/au1100fb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
560560
/* Blank the LCD */
561561
au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
562562

563-
if (fbdev->lcdclk)
564-
clk_disable(fbdev->lcdclk);
563+
clk_disable(fbdev->lcdclk);
565564

566565
memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
567566

@@ -577,8 +576,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
577576

578577
memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
579578

580-
if (fbdev->lcdclk)
581-
clk_enable(fbdev->lcdclk);
579+
clk_enable(fbdev->lcdclk);
582580

583581
/* Unblank the LCD */
584582
au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);

drivers/video/fbdev/cirrusfb.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,12 +2184,6 @@ static struct pci_driver cirrusfb_pci_driver = {
21842184
.id_table = cirrusfb_pci_table,
21852185
.probe = cirrusfb_pci_register,
21862186
.remove = cirrusfb_pci_unregister,
2187-
#ifdef CONFIG_PM
2188-
#if 0
2189-
.suspend = cirrusfb_pci_suspend,
2190-
.resume = cirrusfb_pci_resume,
2191-
#endif
2192-
#endif
21932187
};
21942188
#endif /* CONFIG_PCI */
21952189

drivers/video/fbdev/intelfb/intelfbdrv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static int intelfb_pci_register(struct pci_dev *pdev,
472472
struct fb_info *info;
473473
struct intelfb_info *dinfo;
474474
int i, err, dvo;
475-
int aperture_size, stolen_size;
475+
int aperture_size, stolen_size = 0;
476476
struct agp_kern_info gtt_info;
477477
int agp_memtype;
478478
const char *s;
@@ -571,7 +571,7 @@ static int intelfb_pci_register(struct pci_dev *pdev,
571571
return -ENODEV;
572572
}
573573

574-
if (intelfbhw_get_memory(pdev, &aperture_size,&stolen_size)) {
574+
if (intelfbhw_get_memory(pdev, &aperture_size, &stolen_size)) {
575575
cleanup(dinfo);
576576
return -ENODEV;
577577
}

drivers/video/fbdev/intelfb/intelfbhw.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,11 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
201201
case PCI_DEVICE_ID_INTEL_945GME:
202202
case PCI_DEVICE_ID_INTEL_965G:
203203
case PCI_DEVICE_ID_INTEL_965GM:
204-
/* 915, 945 and 965 chipsets support a 256MB aperture.
205-
Aperture size is determined by inspected the
206-
base address of the aperture. */
207-
if (pci_resource_start(pdev, 2) & 0x08000000)
208-
*aperture_size = MB(128);
209-
else
210-
*aperture_size = MB(256);
204+
/*
205+
* 915, 945 and 965 chipsets support 64MB, 128MB or 256MB
206+
* aperture. Determine size from PCI resource length.
207+
*/
208+
*aperture_size = pci_resource_len(pdev, 2);
211209
break;
212210
default:
213211
if ((tmp & INTEL_GMCH_MEM_MASK) == INTEL_GMCH_MEM_64M)

drivers/video/fbdev/omap/sossi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void sossi_set_bits_per_cycle(int bpc)
359359
int bus_pick_count, bus_pick_width;
360360

361361
/*
362-
* We set explicitly the the bus_pick_count as well, although
362+
* We set explicitly the bus_pick_count as well, although
363363
* with remapping/reordering disabled it will be calculated by HW
364364
* as (32 / bus_pick_width).
365365
*/

drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned long hfbitclk,
143143
/*
144144
* In OMAP5+, the HFBITCLK must be divided by 2 before issuing the
145145
* HDMI_PHYPWRCMD_LDOON command.
146-
*/
146+
*/
147147
if (phy_feat->bist_ctrl)
148148
REG_FLD_MOD(phy->base, HDMI_TXPHY_BIST_CONTROL, 1, 11, 11);
149149

drivers/video/fbdev/pxa3xx-gcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,
381381
struct pxa3xx_gcu_batch *buffer;
382382
struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
383383

384-
int words = count / 4;
384+
size_t words = count / 4;
385385

386386
/* Does not need to be atomic. There's a lock in user space,
387387
* but anyhow, this is just for statistics. */

drivers/video/fbdev/simplefb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ static int simplefb_clocks_get(struct simplefb_par *par,
237237
if (IS_ERR(clock)) {
238238
if (PTR_ERR(clock) == -EPROBE_DEFER) {
239239
while (--i >= 0) {
240-
if (par->clks[i])
241-
clk_put(par->clks[i]);
240+
clk_put(par->clks[i]);
242241
}
243242
kfree(par->clks);
244243
return -EPROBE_DEFER;

drivers/video/fbdev/skeletonfb.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static const struct fb_fix_screeninfo xxxfb_fix = {
9696

9797
/*
9898
* Modern graphical hardware not only supports pipelines but some
99-
* also support multiple monitors where each display can have its
99+
* also support multiple monitors where each display can have
100100
* its own unique data. In this case each display could be
101101
* represented by a separate framebuffer device thus a separate
102102
* struct fb_info. Now the struct xxx_par represents the graphics
@@ -838,9 +838,9 @@ static void xxxfb_remove(struct pci_dev *dev)
838838
*
839839
* See Documentation/driver-api/pm/devices.rst for more information
840840
*/
841-
static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
841+
static int xxxfb_suspend(struct device *dev)
842842
{
843-
struct fb_info *info = pci_get_drvdata(dev);
843+
struct fb_info *info = dev_get_drvdata(dev);
844844
struct xxxfb_par *par = info->par;
845845

846846
/* suspend here */
@@ -853,9 +853,9 @@ static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
853853
*
854854
* See Documentation/driver-api/pm/devices.rst for more information
855855
*/
856-
static int xxxfb_resume(struct pci_dev *dev)
856+
static int xxxfb_resume(struct device *dev)
857857
{
858-
struct fb_info *info = pci_get_drvdata(dev);
858+
struct fb_info *info = dev_get_drvdata(dev);
859859
struct xxxfb_par *par = info->par;
860860

861861
/* resume here */
@@ -873,14 +873,15 @@ static const struct pci_device_id xxxfb_id_table[] = {
873873
{ 0, }
874874
};
875875

876+
static SIMPLE_DEV_PM_OPS(xxxfb_pm_ops, xxxfb_suspend, xxxfb_resume);
877+
876878
/* For PCI drivers */
877879
static struct pci_driver xxxfb_driver = {
878880
.name = "xxxfb",
879881
.id_table = xxxfb_id_table,
880882
.probe = xxxfb_probe,
881883
.remove = xxxfb_remove,
882-
.suspend = xxxfb_suspend, /* optional but recommended */
883-
.resume = xxxfb_resume, /* optional but recommended */
884+
.driver.pm = xxxfb_pm_ops, /* optional but recommended */
884885
};
885886

886887
MODULE_DEVICE_TABLE(pci, xxxfb_id_table);

0 commit comments

Comments
 (0)