From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AEEEC43461 for ; Mon, 7 Sep 2020 16:10:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 222432054F for ; Mon, 7 Sep 2020 16:10:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VocdMNhT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730357AbgIGQKg (ORCPT ); Mon, 7 Sep 2020 12:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729932AbgIGOdi (ORCPT ); Mon, 7 Sep 2020 10:33:38 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5055DC061573; Mon, 7 Sep 2020 07:33:36 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id t23so16407734ljc.3; Mon, 07 Sep 2020 07:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=62zNFkwm//4ntRqXyoEhNkr7gnf03DDFz7QWu/35PZQ=; b=VocdMNhTjr1eQ4qg1fl2wRIHbb+HZvmt4o+WUEpVvs7y6bpPKjoa+HsJYFjpX0hSNH hWqcUmXVgsFDbDOXLvQROEHE5nMX1iiaYDd6I4uVBj2xycK9KqqfOm++ygAmY9CYhpIt T771ZjzgJtVyJ82GR+Ny0mULHLBstcRFrQWnLY+unp671gfIgtalUupR3U42juLLtP6h 2oE7Fh49ujqezOWYGqsCUNXvS7AYTMbdskXCWOFbFnKScOI+LxfV/w5HWoemgPB8fv+X EUebjBQotKv3mkSLsiTGWeEiLqzHG/les2EHHR6wDI1/duG7A15HEtjoKQoIWPKaVsf0 f3ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=62zNFkwm//4ntRqXyoEhNkr7gnf03DDFz7QWu/35PZQ=; b=gIvVq7VXpyIv+OF8BtYDOzSJplEUytPX7fuQ9DTdN/tBthD2lJ7HzZK0g7CcOhvhlk G5aodTrRDAo4QiXERgmwDHslBb6uWq2gK4ChGocyesS95CaZEnLeVsdydQFM/intM4m5 wU5KfOQsZEkXxLPHx/pAuzWshFj68GvD9bWQhhq4+iNhHYeXWMe9E3SUixEiRhKfPVqk gyvM33ty0LLCnNBI7hTJhWBt6D020bA5geKTJCvxm9uzQiadXpkeNDL6TOZcJw4FgFVq BXoN5mH4rBgaBZmNwZHuEa4N6tkxhkOpsgavEJLgqQ090nfRJQK6GYTfwCcx3RFyexv4 MTow== X-Gm-Message-State: AOAM531+NWXOfiu1E/nCa7CgaYWMFdG5AIZ6mcQnMpxbmiMhx5ZmE4t7 cr7jCQMEws0ggj+gt+hSHMytAd3gC3g= X-Google-Smtp-Source: ABdhPJwC6KBpcYD8vM0x+aa2VAoR2OO3AIuOQ1WyISe8il59xTaXwK4vUu8B20fNP6s1lWCFHHeO1A== X-Received: by 2002:a2e:911:: with SMTP id 17mr11317863ljj.207.1599489209563; Mon, 07 Sep 2020 07:33:29 -0700 (PDT) Received: from [192.168.2.145] (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.googlemail.com with ESMTPSA id n2sm6243490lji.97.2020.09.07.07.33.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Sep 2020 07:33:29 -0700 (PDT) Subject: Re: [PATCH v5 13/36] i2c: tegra: Clean up probe function To: Andy Shevchenko Cc: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , linux-i2c , linux-tegra@vger.kernel.org, Linux Kernel Mailing List References: <20200906185039.22700-1-digetx@gmail.com> <20200906185039.22700-14-digetx@gmail.com> From: Dmitry Osipenko Message-ID: <1477bf0e-5723-8781-05bd-0f30c0b9c3a7@gmail.com> Date: Mon, 7 Sep 2020 17:33:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 07.09.2020 11:20, Andy Shevchenko пишет: > On Sun, Sep 6, 2020 at 9:51 PM Dmitry Osipenko wrote: >> >> The driver's probe function code is a bit difficult to read. This patch >> reorders code of the probe function, forming groups of code that are easy >> to work with. The reset_control_get() now may return -EPROBE_DEFER on >> newer Tegra SoCs because they use BPMP driver that provides reset controls >> and BPMP doesn't come up early during boot, previously rst was protected >> by other checks error checks in the code, hence dev_err_probe() is used >> now for the rst. The probe tear-down order now matches the driver-removal >> order. > > Seems that partially this can be done in the patches that converted to > new/better APIs. Okay, I'll split this patch a bit more. > Also consider the use of a temporary variable for struct device > pointer. It might make your life easier. Whole driver now uses i2c_dev->dev pattern and the "dev" variable originally was used for improving indentation of the error messages that are now gone. Hence there is no real need to keep the temporal variable, IMO.