From patchwork Tue Feb 25 05:08:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183812 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1262974ile; Mon, 24 Feb 2020 21:08:49 -0800 (PST) X-Received: by 2002:a17:902:c693:: with SMTP id r19mr56698556plx.25.1582607329628; Mon, 24 Feb 2020 21:08:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582607329; cv=none; d=google.com; s=arc-20160816; b=UFrme/bl1Zb3ZJelBC+MPVzHSq9C4UHRZlrRMi6fFgWmFm0ID77P3ipBSqKAGqLu8A kqjhUorU7BpL5LVikkGweqSKLwHVxRMqksfDOSqAVWsc0JiVmO2bpc0h67f+LCpQACaJ zPErNxy18vdVFjQszUx9qVNFEzGlzM10xpcHgrAOQPMq5Q6WW0pvKteqapq2flUcfp9J UlH5Ev0QXOv0OtIl5AFNol14lYhmQinCOdd48BPQFKlbt4aDDfEPPjgqsmRF5bJofuLs m7Vl/YFByLNx7bbWshTRyBbZQmTxVavmufgq+ubzgtwKtdXCaL3yVGKD//xFfxMtNfEb Gn3g== 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=4dT1j16IciiytxpKHBSJM5MDLlGyaxsTmdCg+EeHcyk=; b=PizKmxtyR9iwCVKEcCDgNvGkMxLZ8YE8Pc5KRT8inQPLOuDdnZVoqHCvVkfz9oo9/a X/GtKC/+yz+gxsTTmTMGkoNbh28iToURR8g5nw739it6EXAJ2Iag9FJ4wTXXq6FGl9iw wdJv6X5Lx1sVS8TaZElbKYfOHOyvfYhg+bV0RuigC50ayKlgn6IfqQEmuMDI6OyJX2vf ibAcNlAU1Pf0O4dWOmyxDi4/hgkTY7T4Q0QhTMgDUFMp/So4IQmeIIpqTSIcVQZ6ltVq vNVu0Ow7EuCkNSAEX6GqjHDz8C8IHZ6YaUKniOWBdtlZ0KQcP/y/99pqBZ1oJL7Lqwp9 AHNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SCflCDTn; 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 4sor16166867pgk.26.2020.02.24.21.08.49 for (Google Transport Security); Mon, 24 Feb 2020 21:08:49 -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=SCflCDTn; 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=4dT1j16IciiytxpKHBSJM5MDLlGyaxsTmdCg+EeHcyk=; b=SCflCDTnra+X8RiaT5pduzy9d+l2Jf7TMEo1AIIZ6FhWILO3GN9Ia4TZ8MvgxP62y6 jEOxIN/VIFGGTpmGAj+CeyEuBScAnLxMlOwd+W4x1DT/P6Bb5OdUQMHzzFAhe1BWkSxs qLo9A8M32cwjcVdF1rFjfJwcoZlXWkox2tEUaC0NWVSoJX9IY16SKE3LiMNtOTyJpZIj 21HGc6Zd+Etv8SwVpX5TnBsDF28v5Wp7AAc/ckldwD3yetYqqlLCcubZoMXJzTHB8BZC Exjz8ka1Zgo4eysigntlYUxwOsWojDKPFMZjkplzeXMpXb8VQPfXL254YlnOT0okKHuF G9XQ== 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=4dT1j16IciiytxpKHBSJM5MDLlGyaxsTmdCg+EeHcyk=; b=YHifaheBNZg6KXqttECp2IKwPVpCY/5AEzauOw4EgTl0261djTK9eeXaLoQU0d8b4r IBvhXN3rOCQfxE2f4d/GAE8zP46IZeFXfxmCdBo56UydYPaBce4G4IO1LIDEOWgiRXAk aaEN9HYF1MrLyfW1kSkqhPfsrwMj3fSCHLTsqiN9oquIEv53IAHRHcHOSIbY5KZy/4mO TXX0Jq95iePsHeKQZNtma+UOfD07VMwH9pTInDNjoQfOu6bykXGdVXtQvzQTzqOTE+/W bXFL12gqAiqpnL6SLDUXiXWtwo8ZjoRY9rV4MEbTYcQztFTISM8mDntksqSVKirIwctp Lzbw== X-Gm-Message-State: APjAAAXL1SPUg6Tx6I+j5M067OB3bWMzz9Zuv8huuitp3ptg2HxIJpNE 1Lv1EHRAXsKhqlxzzLWTk7v++iuV X-Google-Smtp-Source: APXvYqz6vMRedv6tkkMlwmoMLzeiJWwmaD/B49LsWi3HkfkxgdYxvFNQl+03CHoLiBqwx+ivrRzo9w== X-Received: by 2002:a63:dc0d:: with SMTP id s13mr54109834pgg.129.1582607329264; Mon, 24 Feb 2020 21:08:49 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id r66sm15156450pfc.74.2020.02.24.21.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 21:08:48 -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 , Saravana Kannan , Bjorn Andersson , Liam Girdwood , Mark Brown , Thierry Reding , Linus Walleij , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v5 4/6] driver core: Remove driver_deferred_probe_check_state_continue() Date: Tue, 25 Feb 2020 05:08:26 +0000 Message-Id: <20200225050828.56458-5-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225050828.56458-1-john.stultz@linaro.org> References: <20200225050828.56458-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: Saravana Kannan 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 Reviewed-by: Rafael J. Wysocki Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz --- drivers/base/dd.c | 53 ++++++----------------------------- include/linux/device/driver.h | 1 - 2 files changed, 8 insertions(+), 46 deletions(-) -- 2.17.1 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index fe26f2574a6d..c09e4e7277d4 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 (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) - return -ENODEV; - - if (!deferred_probe_timeout) { - dev_WARN(dev, "deferred probe timeout, ignoring dependency"); - return -ETIMEDOUT; - } - - return -EPROBE_DEFER; -} - /** * driver_deferred_probe_check_state() - Check deferred probe state * @dev: device to check @@ -272,39 +259,15 @@ static int __driver_deferred_probe_check_state(struct device *dev) */ int driver_deferred_probe_check_state(struct device *dev) { - int ret; - - ret = __driver_deferred_probe_check_state(dev); - if (ret != -ENODEV) - return ret; - - 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; + if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) { + dev_warn(dev, "ignoring dependency for device, assuming no driver"); + return -ENODEV; + } - ret = __driver_deferred_probe_check_state(dev); - if (ret != -ENODEV) - return ret; + if (!deferred_probe_timeout) { + dev_WARN(dev, "deferred probe timeout, ignoring dependency"); + return -ETIMEDOUT; + } return -EPROBE_DEFER; } 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); /**