Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1263995ybt; Thu, 18 Jun 2020 04:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwavfCJ+NhNP7mmZqhpb8f9rAY9cGQaMitRfLgtSoy0N8VwwsDtA1Igm6gDN9WEcFIuymOz X-Received: by 2002:a17:906:81cc:: with SMTP id e12mr3717861ejx.67.1592480566325; Thu, 18 Jun 2020 04:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592480566; cv=none; d=google.com; s=arc-20160816; b=QfOIppK4MIBKWK0V6G6zh+xEszojU4kWvZFg5BFVUtY5NVf8HG6JHw5Wakj9Z6XHPu 970WAUV7NueaTMqXZlMdR4pJFq4vnWhTUhjwXKgdJbTmNq8FHAzI7FtpXHkeJze0Legu nfcYwUSL/Kqp0nqQ3ikth5zR07slF2gyiQabDWoU3oha8taFH6wsMsIZNmSoyeUPnQ+6 a+ytXqZxX3S+kFV0Llr8rPdOJT9nkBCEXY1kj4DsWSgcBuPONzF+grNRy0UF2+QQzzR7 STJC4w+h1Hlec7YBJPk5WhvyDow7yASXRkIyOVlvC2NPsHrl26l/AEkYHJuwn1YJOUMV 19cw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=xL8MnbBEKeE2eX0KYYS3435nqTH9YOmvp1IKV9E3F8E=; b=OuWQB519g9neusGPL3AEoN3ycKj/ntIloxbQFzn5FuG25PPOB5exTsPFeyrpjT8iwA 12TDQ//KbnWcgG5LHhmEO2zn803tcjl2Av/AbkzWe7dxztvbfVycmrySIzbhv4GufkYN r7LxLFJ/VgHJi49oOt6dDbYz5wiGVXrXw/LeUY+5BsFjOAtXV1mmo6Z6DFWpsQmMxMcz m14vJUoyXy+r1BZ/rb/y5KXd3gH6IT1/ZwQC6nWdcWW5FknjO+yUvWgMrUFEjYvN8HKb HTv4kQ70SQSNuNUTpU5tgtn4BbL+u/zD2oZocxWUIygrkmUrrQx6rhfGzEDC1jVbehvS CT0A== 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 y13si1915472ede.144.2020.06.18.04.42.19; Thu, 18 Jun 2020 04:42:46 -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 S1729494AbgFRLkA (ORCPT + 99 others); Thu, 18 Jun 2020 07:40:00 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:41390 "EHLO smtp4-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726919AbgFRLkA (ORCPT ); Thu, 18 Jun 2020 07:40:00 -0400 Received: from [192.168.1.91] (unknown [77.207.133.132]) (Authenticated sender: marc.w.gonzalez) by smtp4-g21.free.fr (Postfix) with ESMTPSA id B309219F5B2; Thu, 18 Jun 2020 13:38:37 +0200 (CEST) Subject: Re: [PATCH v5 0/2] Small devm helper for devm implementations From: Marc Gonzalez To: Stephen Boyd , Michael Turquette , Kuninori Morimoto , Russell King , Sudip Mukherjee , Dmitry Torokhov , Guenter Roeck , Bjorn Andersson , Robin Murphy , Geert Uytterhoeven , Arnd Bergmann , Ard Biesheuvel , Greg Kroah-Hartman , Rafael Wysocki , Suzuki Poulose , Mark Rutland Cc: linux-clk , Linux ARM , LKML References: Message-ID: <69f6f7fc-4fb6-248a-684a-b853ee0836bc@free.fr> Date: Thu, 18 Jun 2020 13:38:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello everyone, In my opinion, the small and simple devm_add() helper (and its cousin, devm_vadd) can help make devm code slightly easier to write and maintain. Would anyone care to agree or disagree? :-) Regards. On 10/03/2020 11:11, Marc Gonzalez wrote: > Differences from v4 to v5 > x Fix the grammar in devm_add comments [Geert] > x Undo an unrelated change in devm_clk_put [Geert] > > Differences from v3 to v4 > x Add a bunch of kerneldoc above devm_add() [Greg KH] > x Split patch in two [Greg KH] > > Differences from v2 to v3 > x Make devm_add() return an error-code rather than the raw data pointer > (in case devres_alloc ever returns an ERR_PTR) as suggested by Geert > x Provide a variadic version devm_vadd() to work with structs as suggested > by Geert > x Don't use nested ifs in clk_devm* implementations (hopefully simpler > code logic to follow) as suggested by Geert > > Marc Gonzalez (2): > devres: Provide new helper for devm functions > clk: Use devm_add in managed functions > > drivers/base/devres.c | 28 ++++++++++++ > drivers/clk/clk-devres.c | 97 +++++++++++++++------------------------- > include/linux/device.h | 3 ++ > 3 files changed, 67 insertions(+), 61 deletions(-)