Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4869387yba; Wed, 10 Apr 2019 06:40:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE926ExlGObPq2XWKQCkqyyj78BffS0WAXGR/6BiVDFbjl1WZrlhc6hKo9yhgau7ovBSc+ X-Received: by 2002:aa7:8e55:: with SMTP id d21mr1936583pfr.62.1554903643434; Wed, 10 Apr 2019 06:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554903643; cv=none; d=google.com; s=arc-20160816; b=Jq+DEy+ZrdMl7bbKjISMJG1MJfqEUjFb1akuhe31vGZYW/wnPaZG1k8W4e7j6zDR+i R/6dM9mp7uRI2OmEoYV7jvpsOmfrWiKDwcCUZfD9/h3ozZ9IKp994UWGJ9LMSexG5qbr R7kftaBGiBZgtPzinYzOMCA9WxpEXUM/WI4AZPM5K83JdzkUtqtPpoHyEE5VW5BZfsFh 35snJ6b7f8RrnpfRcfrJz+dhFYmvvvPp+62T6aVV2dCzu61nkHwSCJLddtCkmvrL82Bx 6kzFm86ZICjrEgC1FLW7tBAf02WVfITzRatrZVkB0aNMioGzG7BnQij/3ZNG59gOyzjJ 4wtA== 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:from:references:cc:to:subject:dkim-signature; bh=d2lj74hykPj00NZMz0Gb8iI/0M9PN6OvJ8AkEB2eG0s=; b=oEP8wF4fVEwukzll9Z/Au9+lCdMRtul5/dpaw4PvqbJCjL+6sQo5gkr1RDOtLAnnWF CJgo5t5jUVBGlpmXrn5dLqSpjEy2D2w3I8sF8Azb0I7iyTQ8GyIK8ELCArt9gJd9xTOM oPKAHFZwhiIK1OdagO+0N4mp3Bap1SNxyUg5AmhFPGyAcFzQPdRZ2fZFK3KCRHISI4/F gtL5aBAR4ah8+JgfiT5RsWZKFup60+SoX0/LGCfAUBi9h2NZjFkyd8fTjPxZXZaKrFl0 8FT4ZNs8cJhSEfdoNnvQsHBGaBpwiFCUfB4tr05orsxQKyJMvB5mSmCE+ZAKuwzP1n7k ZmMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fXMzXKbt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v35si8910101plg.187.2019.04.10.06.40.27; Wed, 10 Apr 2019 06:40:43 -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=fail header.i=@gmail.com header.s=20161025 header.b=fXMzXKbt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732542AbfDJNh2 (ORCPT + 99 others); Wed, 10 Apr 2019 09:37:28 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36052 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732017AbfDJNhZ (ORCPT ); Wed, 10 Apr 2019 09:37:25 -0400 Received: by mail-pf1-f194.google.com with SMTP id z5so1514322pfn.3 for ; Wed, 10 Apr 2019 06:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=d2lj74hykPj00NZMz0Gb8iI/0M9PN6OvJ8AkEB2eG0s=; b=fXMzXKbtAbiRmnGWSTr4tQnlmnjhdweLKfJ9VkT+065ZkiU3vbsE9LITV9HPFHOTfQ W8SCj/GoJT7UeiXLXOdoKUxMSJTF+MglMS8CdxRMsK+nUNoF5ML5AsJB4Oqy/kerY7pF Ijtdfn5cs2gZIk4MgRxVFlShy2Rm4vYEglO4raSWzcE2j3MHD0iA+Mez2wnRC/btzCy3 BQGAyGCKxLRw2oQexiKkspLCbIQo4XMm0m1Vi7LyBESlPxiLTm6l6VOG17pxzQnkvgGL 9AqV2iL+XTCuF8g258CDpE7YGpZ7F6FMhOEep5+RIRUxvMY/UIQukla75o2gS0f7HAvQ nvnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=d2lj74hykPj00NZMz0Gb8iI/0M9PN6OvJ8AkEB2eG0s=; b=lGJLlCRnRQq6x9FSqtI+Q5x1Wx0ppWKFzptb6SF/k+N3dxf17in8SJBLulsk2d436P Cp/3l7JmgE0Z0+ZKMmdmuSWWQi1yQagvTUpacvJMEEEyRzWhqNtTv4CkpEVrSEF6/LyK S8F3fQQQzJrsovkDv4DV/vHeZu4538IvUSwHptuJJWp71NZua4mjx3nwX9LW9GO1zTgU eb42F5tVvcyfXzrtMQFjf7QaNvpF+6C6RgG7SjGKtfnGdrm4UFZGX4AOYOgOIhSd2pO7 pldoU+mo/4Z9irLn7w62Yjb2xDkABKNKEHSDtTsUhXkIMZDJdCOaBPQZd9qpx7c/3YC6 CV2A== X-Gm-Message-State: APjAAAWeEeyV9YVuD6l4716lCNpoRt/D8i9mNQOEdp4MU2zsE8RQzkKz ZYSAN+VrTadYABqtdfImUAjBlwVl X-Received: by 2002:a62:47d0:: with SMTP id p77mr43492338pfi.95.1554903444612; Wed, 10 Apr 2019 06:37:24 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c3sm50109465pfo.2.2019.04.10.06.37.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 06:37:23 -0700 (PDT) Subject: Re: [PATCH 23/23] watchdog: tangox_wdt: Convert to use device managed functions and other improvements To: Marc Gonzalez , Wim Van Sebroeck Cc: LKML , Mans Rullgard , Dmitry Torokhov References: <1554830641-9247-1-git-send-email-linux@roeck-us.net> <1554830641-9247-24-git-send-email-linux@roeck-us.net> <6ebee4d6-c650-c322-a966-4269d54da9be@free.fr> From: Guenter Roeck Message-ID: Date: Wed, 10 Apr 2019 06:37:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6ebee4d6-c650-c322-a966-4269d54da9be@free.fr> Content-Type: text/plain; charset=utf-8; format=flowed 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 On 4/10/19 6:04 AM, Marc Gonzalez wrote: > On 09/04/2019 19:24, Guenter Roeck wrote: > >> Use device managed functions to simplify error handling, reduce >> source code size, improve readability, and reduce the likelyhood of bugs. >> Other improvements as listed below. >> >> The conversion was done automatically with coccinelle using the >> following semantic patches. The semantic patches and the scripts >> used to generate this commit log are available at >> https://github.com/groeck/coccinelle-patches >> >> - Drop assignments to otherwise unused variables >> - Drop unnecessary braces around conditional return statements >> - Drop empty remove function >> - Use devm_add_action_or_reset() for calls to clk_disable_unprepare >> - Replace stop on remove with call to watchdog_stop_on_unregister() >> - Use devm_watchdog_register_driver() to register watchdog device > > No devm_clk_prepare() in mainline? :-( > > https://lore.kernel.org/patchwork/patch/755487/ > We went through that several times and never succeeded. This was the major reason why I didn't submit this series earlier since I was hoping for it to appear at some point. Unfortunately, someone always objected, typically with comments along the line that it could be misused, or citing individual examples where the current code in some driver is wrong and should be fixed instead. This isn't really a technical argument: Everything can be misused, and all code has bugs. Neither is a reason to reject a new useful API. As such, one has to assume that after refuting such arguments, and even after fixing all bugs in existing code, the opponents of the new API will come up with other reasons to reject it. At the end, I gave up trying. Feel free to try yourself; I most definitely won't try it anymore. Using devm_add_action_or_reset() is a bit more clumsy, but works just as well. Guenter