Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827AbcLLST1 (ORCPT ); Mon, 12 Dec 2016 13:19:27 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:34390 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbcLLST0 (ORCPT ); Mon, 12 Dec 2016 13:19:26 -0500 MIME-Version: 1.0 In-Reply-To: References: <1481479310-2698-1-git-send-email-arvind.yadav.cs@gmail.com> From: Fabio Estevam Date: Mon, 12 Dec 2016 16:19:24 -0200 Message-ID: Subject: Re: [V1] mtd: devices: docg3:- Handle return value of devm_ioremap. To: Marek Vasut Cc: Arvind Yadav , Robert Jarzmik , David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger , Cyrille Pitchen , "linux-mtd@lists.infradead.org" , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 438 Lines: 12 On Sun, Dec 11, 2016 at 5:15 PM, Marek Vasut wrote: >> ret = -ENOMEM; >> + base = devm_ioremap(dev, ress->start, DOC_IOSPACE_SIZE); >> + if (!base) >> + return ret; > > I think return -ENOMEM right away won't hurt here. Also, dev_err() > explaining the failure would be nice to add. There is no need to add dev_err() message as the mm core will complain loudly if devm_ioremap() fails.