Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbbLUX2n (ORCPT ); Mon, 21 Dec 2015 18:28:43 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:40636 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbbLUX2l (ORCPT ); Mon, 21 Dec 2015 18:28:41 -0500 Subject: Re: [PATCH 1/5] watchdog: Create watchdog device in watchdog_dev.c To: Damien Riegel , linux-watchdog@vger.kernel.org, Wim Van Sebroeck , Pratyush Anand , Hans de Goede , linux-kernel@vger.kernel.org References: <1450645503-16661-1-git-send-email-linux@roeck-us.net> <1450645503-16661-2-git-send-email-linux@roeck-us.net> <20151221173123.GD12696@localhost> From: Guenter Roeck Message-ID: <56788B27.20706@roeck-us.net> Date: Mon, 21 Dec 2015 15:28:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151221173123.GD12696@localhost> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1358 Lines: 33 On 12/21/2015 09:31 AM, Damien Riegel wrote: > On Sun, Dec 20, 2015 at 01:04:59PM -0800, Guenter Roeck wrote: >> The watchdog character device is currently created in watchdog_dev.c, >> and the watchdog device in watchdog_core.c. This results in >> cross-dependencies, since device creation needs to know the watchdog >> character device number as well as the watchdog class, both of which >> reside in watchdog_dev.c. >> >> Create the watchdog device in watchdog_dev.c to simplify the code. >> >> Inspired by earlier patch set from Damien Riegel. > > Hi Guenter, > > The main purpose of my patch was to inverse the device creation and the > cdev registration to avoid a racy situation, bu you have dropped that in > this version. Is there a reason for that? > Every other driver I looked at does it in the same order (cdev first, device second). I don't really know if doing it differently has any undesired side effect, so I wanted to play safe. It would help a lot if someone listening to this exchange can confirm that it is ok to create the device first, followed by the character device. Thanks, Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/