From patchwork Wed Aug 29 07:42:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10579613 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 428441709 for ; Wed, 29 Aug 2018 07:42:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 359732A7A5 for ; Wed, 29 Aug 2018 07:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27F512A7BB; Wed, 29 Aug 2018 07:42:46 +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.9 required=2.0 tests=BAYES_00,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 41F412A7A5 for ; Wed, 29 Aug 2018 07:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbeH2LiS (ORCPT ); Wed, 29 Aug 2018 07:38:18 -0400 Received: from sauhun.de ([88.99.104.3]:44848 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727072AbeH2LiS (ORCPT ); Wed, 29 Aug 2018 07:38:18 -0400 Received: from localhost (p54B3352D.dip0.t-ipconnect.de [84.179.53.45]) by pokefinder.org (Postfix) with ESMTPSA id 041CE343CE4; Wed, 29 Aug 2018 09:42:42 +0200 (CEST) From: Wolfram Sang To: linux-watchdog@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda , Wolfram Sang Subject: [RFC PATCH v3 0/4] watchdog: prevent removing a driver if NOWAYOUT Date: Wed, 29 Aug 2018 09:42:37 +0200 Message-Id: <20180829074241.1943-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP So, here is my second approach, now avoiding probe() and targetting the init call. To avoid boilerplate, I introduced macros similar to module_driver(). It still feels a little adventurous because of hard-coding '.driver.suppress_bind_attts' in the macro and trusting various driver types (like platform and PCI) to follow this structure. Having all this said, it works nicely on my Renesas Salvator-XS (R-Car M3-N). build bot is happy. A git branch can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/wdt-suppress-attr Looking forward to comments. Thanks, Wolfram Changes since V2: * keep the remove callback valid * remove 'if' from macro Wolfram Sang (4): watchdog: core: add mechanism to prevent removing if NOWAYOUT watchdog: renesas_wdt: avoid removing if NOWAYOUT watchdog: core: add module_watchdog_pci_driver() watchdog: i6300esb: avoid removing if NOWAYOUT drivers/watchdog/i6300esb.c | 2 +- drivers/watchdog/renesas_wdt.c | 2 +- include/linux/watchdog.h | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-)