Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp516190pxb; Thu, 19 Nov 2020 07:07:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6gqq8o3cfBNb7Q2BrYILCw3Eq6J8rZlmWWgN1YdSlfBp1HdGBr5Lh2n8qrBkScQ8uasL8 X-Received: by 2002:a05:6402:1701:: with SMTP id y1mr31003669edu.209.1605798462660; Thu, 19 Nov 2020 07:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605798462; cv=none; d=google.com; s=arc-20160816; b=M7fBw7tHGh+c/7rptE6Bk/euH18lid+aSk7vt5a2fdGTjgnLommyCaJ6craUTMKj3e hxxQ3J4cky8keRIJlYMY6oblvzskxQq1ETirMmykLPu6+mZ/em/5TIjpetjuiiNG6w0r 218DtAPMpiy00rS/TiyuP0F6FszbOUTqrMiflcB9K6WMN8NdcdbC8dcfnjeqUOgQY+yk XUY6XIF/ycQ7RA+2Z9/huhZEIT17U4WO6j97XCjv4p6MqjkKbZQMuFWIAwunCOzlS68c 3J1ZZzFfzHvExPapCPLbqkJF5P3DbAggOCKv3dh4CIYnHJ+A6XR+ApNubhPKWYvEvvc5 xgRA== 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:dkim-signature; bh=gv+tzIwOh54GKgX+GFGq0lY1+3CA0ggLubRGTd2BE9w=; b=jDg2+Kil+E6gwtoZ53MTcJh8X0wwqz4zqKe3cJfV1BpOAdr0ivb95if1isbGIK0Rfd kv2PXnmRfRjeC+DijjhZqktix1nJsMhN5vbG38NeB3SvH/PLQsc57rBZ7nwKIRZ+5Tvl rLYfLUr3TNSKZEYVoAuMDBaaynZNrqmDIH8NnSpHM6yl9QwKszyt8z/1WARFP98Lm9m6 R+jKp8rZ06clY3nUJR5Vs7Lt2YMl68/L2o2avX0WrjnQuUrdT9G1qjrAeb9i94/aX23T jV13xD3E35feFEudCLBAYz0tHHZIx2kTqi7bNuWt0nQJDL3DKXBynfEtBym6jFPXtHns kIFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eey761QU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si18562784edq.430.2020.11.19.07.07.15; Thu, 19 Nov 2020 07:07:42 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eey761QU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728228AbgKSPEf (ORCPT + 99 others); Thu, 19 Nov 2020 10:04:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727309AbgKSPEd (ORCPT ); Thu, 19 Nov 2020 10:04:33 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E1DFC0613CF; Thu, 19 Nov 2020 07:04:33 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id f18so4430252pgi.8; Thu, 19 Nov 2020 07:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gv+tzIwOh54GKgX+GFGq0lY1+3CA0ggLubRGTd2BE9w=; b=eey761QUD0kQfmjSWIEkvJhy6HgeRa0qwTMd8qAQYJHAf6XipLC83zhX+lFC7gFNVp GAVVyBLALpmN1TGnka6oRBVRyzFp6bt4DOQyi4fwhzqGOmpf34oFkOWbHO9Avcn4w+vE ZH0RoBdEG/uYDPbKr+bnUVELM2ADphDESll9xy1COCLk6Fxo47UL5CyVn2awv/iit+BJ TNa5DtqK5Nr6tHznyGmnMgEGdlI0BiPAkv+GdKUmh4M0aRujbNcCPhLNWuqLpAECiVrM xRE1N52tC8xF23Vk9HvbyWxM8ZrudSLopbmym9+V5O5xgxONTj1jEKbjbrtYpvnA81XR GmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gv+tzIwOh54GKgX+GFGq0lY1+3CA0ggLubRGTd2BE9w=; b=jvRJSg09A8/5lMTCR1VH+jhTVIBujzZXcR+dGFFLJfgMNqvnnZ+kt5B0Sf+q++2F0+ sxhpHy6sL9GO5lzRqg0UEFZyL0HFULOwh3oq37hqgLQ6eyu1cHPfNvx09f7TuQ+TGqdH Q0vWDhs35jFROYtBkJcqn0fCvTjzr5dhIn1U41mtq339yfKTd6Pp+VN50+Vh6IvZMXu9 m2cRH1erBPBo6CNhf0SZQyVAuwwG3wdE0qzeQg18ew535XxkdbPc4RR4qsA9A9a4bPDv jQrvTmQ4JG2qZ738j06tfvCQ+kgIHx03Hgt736X4vfpsoCC2nbAomYZSXEwCS27LPqyz aDgg== X-Gm-Message-State: AOAM533SM5NwC9HOcJ7OMq8P45GKS9+/jG6t8C5X02xS6zeK97e5EUeL VCwS07//qfKeqEeQ+y/JuY9+NKME1Aw1EITsILk= X-Received: by 2002:a17:90a:4816:: with SMTP id a22mr5138400pjh.228.1605798273031; Thu, 19 Nov 2020 07:04:33 -0800 (PST) MIME-Version: 1.0 References: <20201119142104.85566-1-alexandru.ardelean@analog.com> In-Reply-To: <20201119142104.85566-1-alexandru.ardelean@analog.com> From: Andy Shevchenko Date: Thu, 19 Nov 2020 17:05:21 +0200 Message-ID: Subject: Re: [PATCH] gpio: xra1403: remove unneeded spi_set_drvdata() To: Alexandru Ardelean Cc: "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Nandor Han , Semi Malinen , Linus Walleij , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 4:17 PM Alexandru Ardelean wrote: > > There is no matching spi_get_drvdata() call in the driver, so there is no > need to do spi_set_drvdata(). This looks like it probably was copied from a > driver that used both spi_set_drvdata() & spi_get_drvdata(). While above luckily (*) okay it may not always be the case. *) it can be paired with dev_get_drvdata() which is usual for PM callbacks. With amended commit message Reviewed-by: Andy Shevchenko > Signed-off-by: Alexandru Ardelean > --- > drivers/gpio/gpio-xra1403.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-xra1403.c b/drivers/gpio/gpio-xra1403.c > index e2cac12092af..49c878cfd5c6 100644 > --- a/drivers/gpio/gpio-xra1403.c > +++ b/drivers/gpio/gpio-xra1403.c > @@ -186,15 +186,7 @@ static int xra1403_probe(struct spi_device *spi) > return ret; > } > > - ret = devm_gpiochip_add_data(&spi->dev, &xra->chip, xra); > - if (ret < 0) { > - dev_err(&spi->dev, "Unable to register gpiochip\n"); > - return ret; > - } > - > - spi_set_drvdata(spi, xra); > - > - return 0; > + return devm_gpiochip_add_data(&spi->dev, &xra->chip, xra); > } > > static const struct spi_device_id xra1403_ids[] = { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko