From patchwork Fri Sep 29 10:50:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9977483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EF3A60329 for ; Fri, 29 Sep 2017 10:51:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 331C429783 for ; Fri, 29 Sep 2017 10:51:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27FEA29810; Fri, 29 Sep 2017 10:51:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5BD029783 for ; Fri, 29 Sep 2017 10:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbdI2KvK (ORCPT ); Fri, 29 Sep 2017 06:51:10 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:43868 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbdI2KvJ (ORCPT ); Fri, 29 Sep 2017 06:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=me5tFKr3dFV6ZZ/NMj8P0X1tISdIrS594f3j88FGA2s=; b=Z2noD1hjrQV6GrPbRjDRIjePj2OJrSEiyut/bwBBFI2gD8VBEfgyr+akVuG4BXRfYay4xbfn3+3RhOqCFQp5mzKNsRx+JA94PSlfjbwC0Z8p33ZR93PqpIGr6vmVYsq3YHm0nm8tOrhODoThwUq15OpeDqQC8m5wIqx8fqqA+Lc=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:52230 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1dxsss-0000Xr-Bl; Fri, 29 Sep 2017 11:51:06 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1dxssi-0006im-JD; Fri, 29 Sep 2017 11:50:56 +0100 In-Reply-To: <20170929105004.GY20805@n2100.armlinux.org.uk> References: <20170929105004.GY20805@n2100.armlinux.org.uk> From: Russell King To: Bartlomiej Zolnierkiewicz Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH 1/8] video: sa1100fb: use devm_kzalloc() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 29 Sep 2017 11:50:56 +0100 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_kzalloc() when allocating the private data for the framebuffer device. Signed-off-by: Russell King --- drivers/video/fbdev/sa1100fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index fc2aaa5aca23..05a80e08dcde 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -1132,12 +1132,11 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev) struct sa1100fb_info *fbi; unsigned i; - fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16, - GFP_KERNEL); + fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info) + sizeof(u32) * 16, + GFP_KERNEL); if (!fbi) return NULL; - memset(fbi, 0, sizeof(struct sa1100fb_info)); fbi->dev = dev; strcpy(fbi->fb.fix.id, SA1100_NAME); @@ -1292,7 +1291,6 @@ static int sa1100fb_probe(struct platform_device *pdev) iounmap(fbi->base); if (fbi->clk) clk_put(fbi->clk); - kfree(fbi); release_mem_region(res->start, resource_size(res)); return ret; }