From patchwork Tue Apr 9 17:23:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10891829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E61DF1515 for ; Tue, 9 Apr 2019 17:24:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D445E2893F for ; Tue, 9 Apr 2019 17:24:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C761728944; Tue, 9 Apr 2019 17:24:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 674122893F for ; Tue, 9 Apr 2019 17:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbfDIRYM (ORCPT ); Tue, 9 Apr 2019 13:24:12 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39352 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726431AbfDIRYM (ORCPT ); Tue, 9 Apr 2019 13:24:12 -0400 Received: by mail-pg1-f195.google.com with SMTP id k3so9688086pga.6; Tue, 09 Apr 2019 10:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=KzE6pQkr38YFZeyJkyYMlCVCFIA7T3NhcogtQq7roUw=; b=i4Dup9ujLGmWudqLS6JnGWF7SuxlKMqjS6pLFL1T4MnuNe4eCpoMrhOFOByuwyXJo/ P4ZAh45JqgstUAjn0kov6on4+8QIiq/JYPyxqeq0Y/YPA5HWrg/7oiBH5EAFgr5grGIP zg4mxTdUB7BopHuZuojBPtUnhvjzEPmOihPjVfJRNF9maKhmdgQUITlOu7Wc9SJJhyy1 +eIrDN6Z1QxZMRMEq7g6imODUSuIN47dZjPwYjp0/FhZk9doKr+OTpOL4b8YnxIz+hC8 ysL174u0rNJs86bG2dh5oROXrjTmGZb75FX1gsfvv4XQq74fDQPz6j3yTATNR/v4yCCu r3OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=KzE6pQkr38YFZeyJkyYMlCVCFIA7T3NhcogtQq7roUw=; b=ZU+FLfxYQPDnzff7gITlc0M5GrYg8I329PihW2264rIuV9L71AnhuLFo6IFJVhIYyz vdozFnjoC9aUDt4MciiYzPIo5INOZNUtMW8L8+Djp7h/lGd+0oAJR4l9+h2X7DIdZsPp 9y84633hJdddxw9ftDthydv+ZYWkt/b9nrmVa7eZ/404sXMJa12Tt+Chn0nMg7RzGTMA i/Q4G9yI8zoWSo1Bh4g7TamYc6e+tRGV18tKlW5BUbTp6J3NGkVIbtXwaQxsuT3kHM/t Y3Udf15/fesiy8SliZxFDITVi+4b+e7OboJGcnpVz73HueWFdAStUHFrnHAcJWGAqNm9 h0hA== X-Gm-Message-State: APjAAAXBkxL4TX/QgDv+fy2x/tuVBwzOVftXWMOgoOx7iwOO+AnEJqVm OfTRTOGwwCoC9PaA8W75kxyWnTEP X-Google-Smtp-Source: APXvYqzgFpm4dDRv2ZFmwC7RJ9EoI9zv471Y+NYdeLIAVkj1QAGuL0siw4OwgEO4bB3mouMkbe46qA== X-Received: by 2002:aa7:9392:: with SMTP id t18mr38203831pfe.45.1554830651854; Tue, 09 Apr 2019 10:24:11 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 4sm54172681pgx.68.2019.04.09.10.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 10:24:09 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 00/23] watchdog: Expand use of device managed functions (series 2 of 3) Date: Tue, 9 Apr 2019 10:23:38 -0700 Message-Id: <1554830641-9247-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use device managed functions and other changes to simplify error handling, reduce source code size, improve readability, and reduce the likelyhood of bugs. The changes made in this series can be summarized to - Use devm_add_action_or_reset() for calls to clk_disable_unprepare - Use devm_watchdog_register_driver() to register watchdog device - Replace 'of_clk_get(np, 0)' with 'devm_clk_get(dev, NULL)' - Drop assignments to otherwise unused variables - Drop unnecessary braces around conditional return statements - Drop empty remove function - Replace shutdown function with call to watchdog_stop_on_reboot() - Replace stop on remove with call to watchdog_stop_on_unregister() - Replace 'goto l; ... l: return e;' with 'return e;' - Replace 'ret = e; return ret;' with 'return e;'. - Use local variable 'struct device *dev' consistently - Introduce local variable 'struct device *dev' and use it instead of dereferencing it repeatedly - Drop unnecessary calls to platform_set_drvdata() Conversions were performed automatically with coccinelle using a number of semantic patches. The semantic patches and the scripts used to generate commit logs are available at https://github.com/groeck/coccinelle-patches. All patches were compile tested and manually reviewed. This is the second of (at least) three series of similar patches for watchdog drivers.