From patchwork Tue Dec 3 16:38:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 11271621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51795112B for ; Tue, 3 Dec 2019 16:39:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A6E7206E4 for ; Tue, 3 Dec 2019 16:39:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A6E7206E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81D376E9F1; Tue, 3 Dec 2019 16:39:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60E396E9F1; Tue, 3 Dec 2019 16:39:15 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2019 08:39:14 -0800 X-IronPort-AV: E=Sophos;i="5.69,273,1571727600"; d="scan'208";a="205035914" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2019 08:39:12 -0800 From: Jani Nikula To: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH v3 02/12] video: fbdev: mb862xx: modify the static fb_ops directly Date: Tue, 3 Dec 2019 18:38:44 +0200 Message-Id: <51f55c02ea4057cc46335ca5c447b92a55383f77.1575390740.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Avoid modifying the fb_ops via info->fbops to let us make the pointer const in the future. Drop the unnecessary EXPORT_SYMBOL() while at it. Cc: linux-fbdev@vger.kernel.org Signed-off-by: Jani Nikula --- drivers/video/fbdev/mb862xx/mb862xxfb.h | 2 +- drivers/video/fbdev/mb862xx/mb862xxfb_accel.c | 15 +++++++-------- drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/video/fbdev/mb862xx/mb862xxfb.h b/drivers/video/fbdev/mb862xx/mb862xxfb.h index 50bc9b584ca1..52a77ea4e849 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfb.h +++ b/drivers/video/fbdev/mb862xx/mb862xxfb.h @@ -89,7 +89,7 @@ struct mb862xxfb_par { u32 pseudo_palette[16]; }; -extern void mb862xxfb_init_accel(struct fb_info *info, int xres); +extern void mb862xxfb_init_accel(struct fb_info *info, struct fb_ops *fbops, int xres); #ifdef CONFIG_FB_MB862XX_I2C extern int mb862xx_i2c_init(struct mb862xxfb_par *par); extern void mb862xx_i2c_exit(struct mb862xxfb_par *par); diff --git a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c index f58ff900e82a..42569264801f 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c @@ -303,19 +303,19 @@ static void mb86290fb_fillrect(struct fb_info *info, mb862xxfb_write_fifo(7, cmd, info); } -void mb862xxfb_init_accel(struct fb_info *info, int xres) +void mb862xxfb_init_accel(struct fb_info *info, struct fb_ops *fbops, int xres) { struct mb862xxfb_par *par = info->par; if (info->var.bits_per_pixel == 32) { - info->fbops->fb_fillrect = cfb_fillrect; - info->fbops->fb_copyarea = cfb_copyarea; - info->fbops->fb_imageblit = cfb_imageblit; + fbops->fb_fillrect = cfb_fillrect; + fbops->fb_copyarea = cfb_copyarea; + fbops->fb_imageblit = cfb_imageblit; } else { outreg(disp, GC_L0EM, 3); - info->fbops->fb_fillrect = mb86290fb_fillrect; - info->fbops->fb_copyarea = mb86290fb_copyarea; - info->fbops->fb_imageblit = mb86290fb_imageblit; + fbops->fb_fillrect = mb86290fb_fillrect; + fbops->fb_copyarea = mb86290fb_copyarea; + fbops->fb_imageblit = mb86290fb_imageblit; } outreg(draw, GDC_REG_DRAW_BASE, 0); outreg(draw, GDC_REG_MODE_MISC, 0x8000); @@ -326,6 +326,5 @@ void mb862xxfb_init_accel(struct fb_info *info, int xres) FBINFO_HWACCEL_IMAGEBLIT; info->fix.accel = 0xff; /*FIXME: add right define */ } -EXPORT_SYMBOL(mb862xxfb_init_accel); MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c index 962c0171d271..52755b591c14 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c @@ -194,6 +194,8 @@ static int mb862xxfb_check_var(struct fb_var_screeninfo *var, return 0; } +static struct fb_ops mb862xxfb_ops; + /* * set display parameters */ @@ -204,7 +206,7 @@ static int mb862xxfb_set_par(struct fb_info *fbi) dev_dbg(par->dev, "%s\n", __func__); if (par->type == BT_CORALP) - mb862xxfb_init_accel(fbi, fbi->var.xres); + mb862xxfb_init_accel(fbi, &mb862xxfb_ops, fbi->var.xres); if (par->pre_init) return 0;