From patchwork Sat Nov 11 10:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13453053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D71DAC4332F for ; Sat, 11 Nov 2023 10:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9SD/ISbS4wz+ZRXcOG1piDvIPT7n1JLUZtFrYcpz2SY=; b=k8zG4OhVySkwqg lr8zj+RLOXi9Emi+2iP+hLnUjNEGwDOk9eU/DJzvSile7hfThv3xgNNNi7blnw8DzifiF81ZD44vq ZDTyTqVSf3tJQJISee3uTmG0cWnsZu4LBJDxlCED6xnEv9aYDzMU/YeQkrTB5+LApG5AxIQWbHUn4 I/YTybiDhXWKqVRijBNMjja9+MSjMoG+SjKuXAWyQcrSn8vxTOxk4WB4VSTnCUMtDZ5xGiUVBlI3z R6Q1LtpgGf51APZsXhS7++wrzt4oip62DLEdrIc/osYwc4trgJq9BPilbxS8JQR55BVnBF1568tFg BelVMT0VIEhQtS0ckPBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1lS9-00AMNs-1A; Sat, 11 Nov 2023 10:43:01 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1lRw-00AME1-1x for linux-arm-kernel@lists.infradead.org; Sat, 11 Nov 2023 10:42:50 +0000 Received: by mail-ej1-x641.google.com with SMTP id a640c23a62f3a-9e62ab773f1so215587566b.0 for ; Sat, 11 Nov 2023 02:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1699699367; x=1700304167; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uXZvMG+ePha/xCPPyQSZcW7mIHQVo6pfDhdFQ8Ys4tc=; b=iCmU/zvubmhq7y0aLzs59vWGTzl1citOnVGOWwYSEC2Cecx1wAk9lptlleDTaENVMH HeMo22vUKXdlfXDXJrUBkz2JBUB6LCebZJJxWR3+BBg7o4JpvsUWpMoXwM2lEHb+VeXG z3PdWxNcOyA6+UfamtRtJFTOnvfscQOzx+LLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699699367; x=1700304167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uXZvMG+ePha/xCPPyQSZcW7mIHQVo6pfDhdFQ8Ys4tc=; b=v6BariOvs+3mexkfGLCCZ5OLJnwF7Oepr8RPcsxs77ax2OMgOp64XsNsOgzy4wr786 XVptRvnEgmihuDu5AZEvBZHJqcZhhBwuCQWsQgOiS5ZTqXsD2cnPE1G+DavQzuC80axl TScgwy6vRPoaA3OFyxkU0wJEzxQTLEAVzpRJsEpJvHJhUkfTZBgX/IHnIRuVtnKgiRfB jt7rcW25bE7GNmvPERZRqVIzCdxxdZLV15N8TmwjnOXvnc+Tdf4+whKFwYFDceAWick4 /3talZidVzLCj1+vl26jia6S0He3Bijqz28fyYGSelqamOXWerywksVb9PRK13eNykid nctg== X-Gm-Message-State: AOJu0Yzi8LSzc/q4zXBU9gktzGNvK3kktBJDNWVc56GeNrCt0tnLTMao Ltk8LPIp0iF/THbXI2PYD4uVxg== X-Google-Smtp-Source: AGHT+IGJZcFy9OdyadzV+Qr9dejIzMtNTDEhCcEQriAhe7EtSGvFTDpXzYmEJXyYAtgH1pYC278gVQ== X-Received: by 2002:a17:906:fa9b:b0:9dd:6664:1a3a with SMTP id lt27-20020a170906fa9b00b009dd66641a3amr1013488ejb.51.1699699366905; Sat, 11 Nov 2023 02:42:46 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-20-97-182.retail.telecomitalia.it. [79.20.97.182]) by smtp.gmail.com with ESMTPSA id ga33-20020a1709070c2100b0099e12a49c8fsm872183ejc.173.2023.11.11.02.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Nov 2023 02:42:46 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Helge Deller , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH 08/10] fbdev: imxfb: Fix style warnings relating to printk() Date: Sat, 11 Nov 2023 11:41:57 +0100 Message-ID: <20231111104225.136512-9-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> References: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231111_024248_644298_EB2EF21B X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Resolve the following warning reported by checkpatch: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... This made it necessary to move the 'fbi->pdev = pdev' setting to the beginning of the driver's probing. Signed-off-by: Dario Binacchi --- drivers/video/fbdev/imxfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index ad293dc44dbb..a0172ff75c46 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -414,8 +414,8 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) if (--pcr > PCR_PCD_MASK) { pcr = PCR_PCD_MASK; - printk(KERN_WARNING "Must limit pixel clock to %luHz\n", - lcd_clk / pcr); + dev_warn(&fbi->pdev->dev, "Must limit pixel clock to %luHz\n", + lcd_clk / pcr); } switch (var->bits_per_pixel) { @@ -628,28 +628,28 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf #if DEBUG_VAR if (var->xres < 16 || var->xres > 1024) - printk(KERN_ERR "%s: invalid xres %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid xres %d\n", info->fix.id, var->xres); if (var->hsync_len < 1 || var->hsync_len > 64) - printk(KERN_ERR "%s: invalid hsync_len %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid hsync_len %d\n", info->fix.id, var->hsync_len); if (var->left_margin < left_margin_low || var->left_margin > 255) - printk(KERN_ERR "%s: invalid left_margin %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid left_margin %d\n", info->fix.id, var->left_margin); if (var->right_margin < 1 || var->right_margin > 255) - printk(KERN_ERR "%s: invalid right_margin %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid right_margin %d\n", info->fix.id, var->right_margin); if (var->yres < 1 || var->yres > ymax_mask) - printk(KERN_ERR "%s: invalid yres %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid yres %d\n", info->fix.id, var->yres); if (var->vsync_len > 100) - printk(KERN_ERR "%s: invalid vsync_len %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid vsync_len %d\n", info->fix.id, var->vsync_len); if (var->upper_margin > 63) - printk(KERN_ERR "%s: invalid upper_margin %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid upper_margin %d\n", info->fix.id, var->upper_margin); if (var->lower_margin > 255) - printk(KERN_ERR "%s: invalid lower_margin %d\n", + dev_err(&fbi->pdev->dev, "%s: invalid lower_margin %d\n", info->fix.id, var->lower_margin); #endif @@ -701,6 +701,7 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) memset(fbi, 0, sizeof(struct imxfb_info)); + fbi->pdev = pdev; fbi->devtype = pdev->id_entry->driver_data; strscpy(info->fix.id, IMX_NAME, sizeof(info->fix.id)); @@ -1044,7 +1045,6 @@ static int imxfb_probe(struct platform_device *pdev) lcd->props.max_contrast = 0xff; imxfb_enable_controller(fbi); - fbi->pdev = pdev; return 0;