Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp813758pxb; Wed, 27 Oct 2021 12:57:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7h8VHb+r/+nH5zVn/xrXupA6S0rZuLQHlg10Y5XsydOq+VfCgFxitpRe4cIqNvn8lIsyZ X-Received: by 2002:a17:90b:3b81:: with SMTP id pc1mr6929661pjb.153.1635364646192; Wed, 27 Oct 2021 12:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635364646; cv=none; d=google.com; s=arc-20160816; b=MGvG0mbWisBuap2Vg9/ht8I1+hW7ntmRrwlUkyVblj/whtdq+qYSDR/ITXglurMDbh bzfzaf0TY9Np2DcymhI+EHDZSND42fLOiObLyZ0JyZpJ4t0Y9VK7/bHL6v7RiRAlaPAQ 7AVMmD5dy7Zr3mPWH01SLVAHZyba7F11K1Gd58B6Q40WFLlbdkKzQdPhHY7R9iWvqV9N wpEEegc6XleE2Mot3Fe7ckuZ2PSbjbxd6TnV3QLjTQor7M2WoBOzSdnep6sT4WW6lmEY kIBcxBBMXSSfW0DiXConZAi+v6M2hJcKZPZdbC1BROyQh9My4yUsYrdttxEGpt1wlm+r KVqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=m3UqDuembNDHkRgC1yENIlEFdMz5fJYXnnqTuaz01pQ=; b=m258Ow21yBtZqwLaEHrAzFUnxlZqreLQTV4fLbz0Phxjz+eshmYNfL5R7xSlwGp6gm Zp4EtT/1BLtd2ZBH8ZeOjMeIiedBjb3uUyWSfZCTu20PZNRz2XVwIEXK7Z+3MRv0hG94 m2P0Gb1K65YXaZDWLAEbM2ZCSn8SKfOjYOARX9j8/Yc0aOvlovVeNd8OmmZMFPMjXWI3 Zh/zM9z73JMe465fnFBLo/YA9pD2+a4Ms+MiUM4V0ATXQNmFSFeF0Ce4hfTznxiswYXb Ct+pcD37MjtWqKxBFKQzmbb9dnFK/QWSxNu3FeOmojrSV6vG8lvplq90tkms2W5MdJTQ 4PeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d35si1159711pgl.78.2021.10.27.12.56.59; Wed, 27 Oct 2021 12:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240396AbhJ0HUR (ORCPT + 99 others); Wed, 27 Oct 2021 03:20:17 -0400 Received: from mail-ua1-f48.google.com ([209.85.222.48]:41823 "EHLO mail-ua1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhJ0HUQ (ORCPT ); Wed, 27 Oct 2021 03:20:16 -0400 Received: by mail-ua1-f48.google.com with SMTP id u9so3100168uac.8; Wed, 27 Oct 2021 00:17:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m3UqDuembNDHkRgC1yENIlEFdMz5fJYXnnqTuaz01pQ=; b=Wz7OBPIouhRZzQ2GKTK1agYLnGk0NhUfBgdsBA0KNFfW5gxim0kDurwG68h8ZKT5P5 UZcdS0vfzpUgMwBiS6h+wdpD697RN0jgFaYjYFBUTDlrHf6BFqmdrvI8S3HWMjspXG5V QZMLc4Emx+1uWdbP4VxrTARWliTIDlY24MXJqOWjjfMP8VOgXELVC85xa55OsbyODFtm kWLLfXaGs9ZXVW2ZVAFSGt5sRTAJW2anShmY1N0nmO6CYKa1F9KySV0WWYI4zdDs9Vtz bYKxhkAkNrJ0GipikAl3kuMPp5b5W+vYoXVein0EgkGP08D5A0TZSDdFI+chR0rnL1Z/ HHpA== X-Gm-Message-State: AOAM531PUmtZ3J1aJFUs5XhLwDsmuupezsRGBf+/vubpODXwjY6fLcfn Aa4nZ2n4vh/h+VHMP8S+AZR7ml1DbZUFGw== X-Received: by 2002:ab0:812:: with SMTP id a18mr27790678uaf.33.1635319071093; Wed, 27 Oct 2021 00:17:51 -0700 (PDT) Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com. [209.85.221.181]) by smtp.gmail.com with ESMTPSA id n14sm4422861vkc.49.2021.10.27.00.17.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Oct 2021 00:17:50 -0700 (PDT) Received: by mail-vk1-f181.google.com with SMTP id s201so910382vke.6; Wed, 27 Oct 2021 00:17:50 -0700 (PDT) X-Received: by 2002:a1f:1841:: with SMTP id 62mr27839915vky.26.1635319070166; Wed, 27 Oct 2021 00:17:50 -0700 (PDT) MIME-Version: 1.0 References: <20211025205631.21151-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211025205631.21151-6-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20211025205631.21151-6-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Geert Uytterhoeven Date: Wed, 27 Oct 2021 09:17:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/7] memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails To: Lad Prabhakar Cc: Krzysztof Kozlowski , Rob Herring , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown , Philipp Zabel , Wolfram Sang , Sergei Shtylyov , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , MTD Maling List , linux-spi , Linux-Renesas , Prabhakar , Biju Das , Chris Brandt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, CC seebe On Mon, Oct 25, 2021 at 10:57 PM Lad Prabhakar wrote: > Make sure we return error in case devm_ioremap_resource() fails for dirmap > resource. > > Fixes: ca7d8b980b67 ("memory: add Renesas RPC-IF driver") > Signed-off-by: Lad Prabhakar > Reviewed-by: Biju Das > Reviewed-by: Wolfram Sang Thanks for your patch! > --- a/drivers/memory/renesas-rpc-if.c > +++ b/drivers/memory/renesas-rpc-if.c > @@ -243,7 +243,7 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev) > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap"); > rpc->dirmap = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(rpc->dirmap)) > - rpc->dirmap = NULL; > + return PTR_ERR(rpc->dirmap); IIRC, it was intentional to make the dirmap optional (because the device can be used without and/or because some variants on other SoCs lack it?). Unfortunately this is not reflected in the DT bindings (yet?). All code using the dirmap does check if rpc->dirmap is valid first. > rpc->size = resource_size(res); > > rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds