Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5148716ybe; Tue, 17 Sep 2019 03:30:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjS8PxBS+Xn78Rn/EWwTsVbzdIRrQJCFJ9CRSyu8D3/WO0ijgfZ6q5VQBWkUvqBYWT9lCH X-Received: by 2002:a05:6402:1259:: with SMTP id l25mr3863078edw.174.1568716250543; Tue, 17 Sep 2019 03:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568716250; cv=none; d=google.com; s=arc-20160816; b=fGN1EmmE2Nl0VQtuQ6qS3KEQ26SAoi8NENJgKZ119jcFfoHHw9X2LAZhuOXR61HvI4 rem+gVnA34+zVBhnIIkGI7TFpB9iS6qIL9pT2ah8yZOdnKotL3NA2NRR8ZvqoA/KJs9y ezzI/6+L/vGGOmkTolx/63LtNMuYQxHm9K3gu6Ny9VU2NViRasUy/2NO/6pt4fHb5ID5 vzMj0nc6VsOgMH6VoEhaVbM1tPmd5+HR58rnUQGZwRWvOhhnPb0BKcuD8TagwCbnJlSC 2qF623Ca1HkXzUVE1U9YO+ZgmSYw6tmVldIQcOdHcS0H4+sY1gbWRDdf/ogeyPXo5f/W gq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=ftJdTOKlBr/AG20OwG1MTUH8i2f7oG0aNtJYOC26Q5I=; b=0EwEKIU42BGL3PQDJLQRahzISYK9YWrXyE8RGoxQRVkomYBkrCARNWq4T1cb2QsUmJ pky/3Dp3lSRF4pI5X4A/IyukmeFe6+ei+YzBX11ZMmwA5VP0xYbIE19CMka7zwQDSIJm iKHH44lCFwVBqIcv30tx1OgMIBKVoisYwoVSM40k1fLC0FGW32K8ErniMK1gvlqK3ipN nk1uFua139Q7Iz2czKapQ5RMZmTjW+2hvNXB7X12RahhnLpn3QGeb07/WqeV00JT1vYm U/DFBSG1GQcNrYsilKUBa7SOkuhAdi7TM1dU5tnorlj9xWlJTEgzhHgsfOQC4ycU31dK v5VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aurabindo.in header.s=protonmail header.b=h7fwfvpv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=aurabindo.in Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si803162ejv.197.2019.09.17.03.30.27; Tue, 17 Sep 2019 03:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aurabindo.in header.s=protonmail header.b=h7fwfvpv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=aurabindo.in Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726213AbfIQJ6Y (ORCPT + 99 others); Tue, 17 Sep 2019 05:58:24 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]:47085 "EHLO mail-40132.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbfIQJ6X (ORCPT ); Tue, 17 Sep 2019 05:58:23 -0400 Date: Tue, 17 Sep 2019 09:58:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aurabindo.in; s=protonmail; t=1568714301; bh=ftJdTOKlBr/AG20OwG1MTUH8i2f7oG0aNtJYOC26Q5I=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=h7fwfvpvSgI4B6Q40CBaRg5cnJ0/Iz3EmB2KLqRa5RVwn3/TtbQTzhBzyGAQnNZEk NvzxRMs6HVFIIwV5sDuXUPIaB4Ra+CzcDL/4rqAROsAUEleubQTba+ogOA93AeTyuK SeZLT6owgA+nCuFWJwobVVA0qDDrI1ln6SMk7XRI= To: Baolin Wang From: Aurabindo Jayamohanan Cc: Mark Brown , "palmer@sifive.com" , "paul.walmsley@sifive.com" , linux-spi , "linux-riscv@lists.infradead.org" , LKML Reply-To: Aurabindo Jayamohanan Subject: Re: [PATCH] spi: sifive: check return value for platform_get_resource() Message-ID: <7kLa83nF-ufh-AGA_LpBQ6M-ErUf-LEVXANxL2LmirJAh-snvVtJLTVFkBKFxaHvIH9Vi1E3iXDmxW6Ijktoo6k1S7pyFrwmVVLkhKr4Q_Q=@aurabindo.in> In-Reply-To: References: <20190917085627.4562-1-mail@aurabindo.in> Feedback-ID: D1Wwva8zb0UdpJtanaReRLGO3iCsewpGmDn8ZDKmpao-Gnxd2qXPmwwrSQ99r5Q15lmK-D8x6vKzqhUKCgzweA==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.8 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Tuesday, September 17, 2019 2:53 PM, Baolin Wang wrote: > On Tue, 17 Sep 2019 at 17:12, Aurabindo Jayamohanan mail@aurabindo.in wro= te: > > > platform_get_resource() may return NULL. If it is so, return -ENXIO > > > > Signed-off-by: Aurabindo Jayamohanan mail@aurabindo.in > > > > ------------------------------------------------------- > > > > drivers/spi/spi-sifive.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c > > index 93ec2c6cdbfd..67485067a694 100644 > > --- a/drivers/spi/spi-sifive.c > > +++ b/drivers/spi/spi-sifive.c > > @@ -308,6 +308,12 @@ static int sifive_spi_probe(struct platform_device= *pdev) > > platform_set_drvdata(pdev, master); > > > > res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > > > > - if (!res) { > > > > > > - dev_err(&pdev->dev, "no IOMEM resource found\\n"); > > > > > > - ret =3D -ENXIO; > > > > > > - goto put_master; > > > > > > - } > > > > > > Seems unnecessary, the devm_ioremap_resource() already validated if > the resource is available. > Okay, thanks for the headsup