From patchwork Thu Feb 20 05:04:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183654 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp140995ile; Wed, 19 Feb 2020 21:05:07 -0800 (PST) X-Received: by 2002:a63:513:: with SMTP id 19mr31590569pgf.28.1582175106861; Wed, 19 Feb 2020 21:05:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582175106; cv=none; d=google.com; s=arc-20160816; b=sL8mNPVvZ7i5sAhTJj/045qpoVaMPGMM63OWLThyTD6vjKe6EH4zMYUFPrE0+P4Q4z lBfm4Yg4lvXMR8IX5XMG82LbhM6+RIFcT5J1DctRytAFZdX84Zx/PLGKi4Pcj7JSsi/n 8q/MvB6LnV6D7TXyOUzNx0tj1PYUgjgtRbIDAP9yqJAkL7AhA7aWXrX8qEa5VdlwznLM E9d1U3e9QNz8UTY1Ke6fdcRbkJz0u5v1MbvPcpQKCoIf8ePHNp+fkxafYV2AU9Z3DxNm J25lcLTihEz31r5Y+wNF8l7NGyAKyQxleHQ4IWBxb+8+zkvy1KNfEnjcMNc/BRdk737n 74BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aixlBG1IUMuyRnlbsO9Bddkyq8kq21Uvz9l57YstKEY=; b=gq6xmpUIpwuiJgq2tg6sp7KjaagUOiag7ZtCkMu1lCMDiU1TeYZVazEHFcFqNZaq8T bQuaJqZjhqJ8S9xjLI+G7pakoaoRwRdPJuD1sSoQ64zJF07934Lj+BtbEk8lv/cRuaUM Mw0UlMCAMEoMq6j6mFFpOZg8tMZucfoJznC4R16Bk15DSVOsoy78sza5eTd4zk5N3z+j nle56FTplnaffnp7M9fXQaylrWWo8coIKmtMkmtab0NONzWUwv7hQmphhTai0NSe8UEm ZMGQhh8rU2aGJwIdtSvBk8yf1mATHH0VNlDbhYhDluk0SatGPHVvknPe8hJRY5hHC1pS 4bPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j2ufgc2A; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h3sor739436pjq.15.2020.02.19.21.05.06 for (Google Transport Security); Wed, 19 Feb 2020 21:05:06 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j2ufgc2A; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aixlBG1IUMuyRnlbsO9Bddkyq8kq21Uvz9l57YstKEY=; b=j2ufgc2A6/zlTZrKnv+kOV8+1hQXXn3hsLZe88ekx9d15lUcmJnyFUmhDsip74svCh pr7/+G5aP6LdzE4a7lEJUZgNTJMhvYQE/MKQ4aG/rMEG02biDlVWqaIUw8PgVwbDxwS1 dSJ/9VHA7hhoPMtn++Xrple53Lem5Nsayidp3GA+3+TlpYNWCwa+N3TKHz5zYeol9AUp trdAnxxH31Bt/cY/j24Bq+ddIJ0mb+gOBv9XXnT3AUQdT4FVG0FHMS/eyoxgshaj0aDe NuXP3JUSwR6i0KECbbq/OVFbX3uAJmVBj+k/4sVu8kBtxetNlMs4NXbFXIasx0g2OUz6 U9Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aixlBG1IUMuyRnlbsO9Bddkyq8kq21Uvz9l57YstKEY=; b=oUCIi194FYQ8jd/O1g8KntRzYq3x86V0XhlDWjgYwmbZBAaivYjjQpwBr7DCdG4r+f E3sXPG3r1z9qp6cumw2a1KHeO4ww0Hr1/7Kf2B3GIkM17IZsfsGWW+M/oYe2f/p8rSMQ CSZkOIx/XwZy4nP8bMLXDmXK5PuRq5xjL7JzKkncAfbwb64svyuJ/lB5+eVbB1oyzlfB Gi1V2fGKQ5PaM/jSlMSb3OZDz5TBoE/Ew/f3hcVz+TJgANiVM7Zs1GaVQGqBGJh4YOoa eHzGNl99Qe6Ub8TpEx4R4B9rRBmSKaKGH+Ezb+e9GgLk4gsGViVaEYif+dY+30jP5ucK J50g== X-Gm-Message-State: APjAAAWTOSadiTCPGUNa2rjmx6p4Ql4csaXnnWSvEpdr9DYF3feQDySg RoRhgJ+7vz3Y8wbPrv9eqXqJ7rJj X-Google-Smtp-Source: APXvYqzmBhGA+NC9IeOnvf5JOOp42iqCCjHX+Qckv0WLtqV7PEDyvMGdktmnkX5JTyIHsNGyOPPQUA== X-Received: by 2002:a17:90a:cc10:: with SMTP id b16mr1393657pju.55.1582175106420; Wed, 19 Feb 2020 21:05:06 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id z4sm1400847pfn.42.2020.02.19.21.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 21:05:05 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Todd Kjos , Bjorn Andersson , Liam Girdwood , Mark Brown , Thierry Reding , Linus Walleij , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v4 4/6] driver core: Remove driver_deferred_probe_check_state_continue() Date: Thu, 20 Feb 2020 05:04:38 +0000 Message-Id: <20200220050440.45878-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220050440.45878-1-john.stultz@linaro.org> References: <20200220050440.45878-1-john.stultz@linaro.org> Now that driver_deferred_probe_check_state() works better, and we've converted the only user of driver_deferred_probe_check_state_continue() we can simply remove it and simplify some of the logic. Cc: Rob Herring Cc: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: Pavel Machek Cc: Len Brown Cc: Todd Kjos Cc: Bjorn Andersson Cc: Liam Girdwood Cc: Mark Brown Cc: Thierry Reding Cc: Linus Walleij Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: John Stultz Change-Id: Id5cd5e9264cfb0fbd70a702715174cc4b10006f4 --- drivers/base/dd.c | 49 +++++------------------------------ include/linux/device/driver.h | 1 - 2 files changed, 6 insertions(+), 44 deletions(-) -- 2.17.1 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index fa138f24e2d3..408e4da081da 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -244,19 +244,6 @@ static int __init deferred_probe_timeout_setup(char *str) } __setup("deferred_probe_timeout=", deferred_probe_timeout_setup); -static int __driver_deferred_probe_check_state(struct device *dev) -{ - if (!initcalls_done || deferred_probe_timeout > 0) - return -EPROBE_DEFER; - - if (!deferred_probe_timeout) { - dev_WARN(dev, "deferred probe timeout, ignoring dependency"); - return -ETIMEDOUT; - } - - return 0; -} - /** * driver_deferred_probe_check_state() - Check deferred probe state * @dev: device to check @@ -272,43 +259,19 @@ static int __driver_deferred_probe_check_state(struct device *dev) */ int driver_deferred_probe_check_state(struct device *dev) { - int ret; + if (!initcalls_done || deferred_probe_timeout > 0) + return -EPROBE_DEFER; - ret = __driver_deferred_probe_check_state(dev); - if (ret < 0) - return ret; + if (!deferred_probe_timeout) { + dev_WARN(dev, "deferred probe timeout, ignoring dependency"); + return -ETIMEDOUT; + } dev_warn(dev, "ignoring dependency for device, assuming no driver"); return -ENODEV; } -/** - * driver_deferred_probe_check_state_continue() - check deferred probe state - * @dev: device to check - * - * Returns -ETIMEDOUT if deferred probe debug timeout has expired, or - * -EPROBE_DEFER otherwise. - * - * Drivers or subsystems can opt-in to calling this function instead of - * directly returning -EPROBE_DEFER. - * - * This is similar to driver_deferred_probe_check_state(), but it allows the - * subsystem to keep deferring probe after built-in drivers have had a chance - * to probe. One scenario where that is useful is if built-in drivers rely on - * resources that are provided by modular drivers. - */ -int driver_deferred_probe_check_state_continue(struct device *dev) -{ - int ret; - - ret = __driver_deferred_probe_check_state(dev); - if (ret < 0) - return ret; - - return -EPROBE_DEFER; -} - static void deferred_probe_timeout_work_func(struct work_struct *work) { struct device_private *private, *p; diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index 1188260f9a02..5242afabfaba 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -238,7 +238,6 @@ driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev) void driver_deferred_probe_add(struct device *dev); int driver_deferred_probe_check_state(struct device *dev); -int driver_deferred_probe_check_state_continue(struct device *dev); void driver_init(void); /**