Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753677AbbLIKze (ORCPT ); Wed, 9 Dec 2015 05:55:34 -0500 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:36874 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751804AbbLIKz3 (ORCPT ); Wed, 9 Dec 2015 05:55:29 -0500 Date: Wed, 9 Dec 2015 10:54:57 +0000 From: Russell King - ARM Linux To: Alexander Aring Cc: Kevin Hilman , Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , Florian Fainelli , Pawel Moll , Stephen Warren , Greg Kroah-Hartman , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Jon Hunter , Eric Anholt , Rob Herring , Lee Jones , Pavel Machek , Len Brown , Ian Campbell , linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/5] power: domain: add pm_genpd_exit Message-ID: <20151209105457.GG8644@n2100.arm.linux.org.uk> References: <1449251148-19344-1-git-send-email-eric@anholt.net> <1449251148-19344-2-git-send-email-eric@anholt.net> <5665599A.4060509@nvidia.com> <7h8u54lqbv.fsf@deeprootsystems.com> <20151209104752.GB1036@omega> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151209104752.GB1036@omega> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 24 On Wed, Dec 09, 2015 at 11:47:58AM +0100, Alexander Aring wrote: > Example: the error case is while probing, how we react on a -EBUSY there > "in an error case" -> simple ignore it? But then nobody see that the use > of this function is wrong. The proper way to deal with functionality that can only be registered but never removed is to report the error, but never fail during probing, and never allow removal (empty removal function.) If you return a failure code during probe, you end up in an inconsistent situation where you have facilities registered, but resources that those facilities require will be undone when probe() returns a failure, and that can potentially lead to kernel oops or scribbling over someone elses device or memory. -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. -- 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/