From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9342C433EF for ; Tue, 16 Nov 2021 00:32:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D22DE619EA for ; Tue, 16 Nov 2021 00:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344000AbhKPAfK (ORCPT ); Mon, 15 Nov 2021 19:35:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:45390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345112AbhKOT0e (ORCPT ); Mon, 15 Nov 2021 14:26:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5FEC63715; Mon, 15 Nov 2021 19:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637003426; bh=DtHrB66HXLmxewymT8yGeifJxpPVREBisB7HVDuwLYk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uWDI6azBQctDhxtdF1G9iKbhqkN2qYhQctn9Q95ee03P+8wXH7qRA3GAepSUdZg2n uKk6RWow7OZupqCCke9iIi2MeT8WkPYc4AvR4GCkYQP6OBFfqIRBToDvoJHxCRdtmJ raMFBms7HRLxupcaecmEaqky9XClk8sQ0odpZa3o= Date: Mon, 15 Nov 2021 19:49:57 +0100 From: Greg Kroah-Hartman To: Iwona Winiarska Cc: linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, Rob Herring , Joel Stanley , Andrew Jeffery , Jean Delvare , Guenter Roeck , Arnd Bergmann , Olof Johansson , Jonathan Corbet , Borislav Petkov , Pierre-Louis Bossart , Tony Luck , Andy Shevchenko , Jae Hyun Yoo , Dan Williams , Randy Dunlap , Zev Weiss , David Muller , Dave Hansen Subject: Re: [PATCH v3 06/13] peci: Add device detection Message-ID: References: <20211115182552.3830849-1-iwona.winiarska@intel.com> <20211115182552.3830849-7-iwona.winiarska@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211115182552.3830849-7-iwona.winiarska@intel.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Nov 15, 2021 at 07:25:45PM +0100, Iwona Winiarska wrote: > +void peci_device_destroy(struct peci_device *device) > +{ > + bool killed; > + > + device_lock(&device->dev); > + killed = kill_device(&device->dev); Eeek, why call this? > + device_unlock(&device->dev); > + > + if (!killed) > + return; What happened if something changed after you unlocked it? Why is kill_device() required at all? That's a very rare function to call, and one that only one "bus" calls today because it is very special (i.e. crazy and broken...) thanks, greg k-h