From patchwork Mon Dec 16 12:31:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 22517 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 303D023FC7 for ; Mon, 16 Dec 2013 12:31:59 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf9561261veb.4 for ; Mon, 16 Dec 2013 04:31:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yYC9GI0zHI0COUKN1lXoe1foyie0w05nzZTKIRL9MXY=; b=bW2uMe623eJY+LvY6zfz2Yfs0+maS8I+2UTbLfvdmT5Q0kF55Avt3hNkHL/d66T9o+ AeUoU1NUBd3pDCHbpSueEU1cOxzgRpkiI2NBgYsaKFSndyAvoXB9/eOwUmbqQcBAn4uq z1IbAx8QyFDl7DGXYXtI/NrAax+ePWPh2Zb7FjC5FSiyqTXvMqRH5KppLnXVW8ktTdBj DKcLPcP50pwilZcZn4Y/MBHc/b6sl/6r8QegxWNQKdoGb8CvecbuNVRpL0msEclh6M8A 03fAstW63Tn45cGk03rotxxOZi47c7q4MbWcLdZ+pJdpv0ayZLjfEV4sVTJ1ZRKk1R+j 2inw== X-Gm-Message-State: ALoCoQnFQYjBfn72OeU/ScTuG926cdjKCWLpIlpu2J+1vZLNdlcZOusRbbCfFU/d3bRDClipuAU4 X-Received: by 10.236.62.231 with SMTP id y67mr5378384yhc.3.1387197118913; Mon, 16 Dec 2013 04:31:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.70 with SMTP id v6ls2026018qec.47.gmail; Mon, 16 Dec 2013 04:31:58 -0800 (PST) X-Received: by 10.58.154.6 with SMTP id vk6mr149376veb.61.1387197118771; Mon, 16 Dec 2013 04:31:58 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id we7si3961768vcb.7.2013.12.16.04.31.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 04:31:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ks9so3052170vcb.26 for ; Mon, 16 Dec 2013 04:31:58 -0800 (PST) X-Received: by 10.220.97.69 with SMTP id k5mr1696970vcn.45.1387197118696; Mon, 16 Dec 2013 04:31:58 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp99613vcz; Mon, 16 Dec 2013 04:31:58 -0800 (PST) X-Received: by 10.205.0.4 with SMTP id nk4mr178288bkb.166.1387197117570; Mon, 16 Dec 2013 04:31:57 -0800 (PST) Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com [209.85.214.43]) by mx.google.com with ESMTPS id cl3si3866433bkc.266.2013.12.16.04.31.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 04:31:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.43 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.214.43; Received: by mail-bk0-f43.google.com with SMTP id mz12so2286373bkb.16 for ; Mon, 16 Dec 2013 04:31:57 -0800 (PST) X-Received: by 10.204.56.69 with SMTP id x5mr336364bkg.115.1387197116982; Mon, 16 Dec 2013 04:31:56 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id tn8sm10445325bkb.16.2013.12.16.04.31.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 04:31:56 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson Subject: [PATCH 2/2] mmc: core: Remove unnecessary validations for bus_ops callbacks Date: Mon, 16 Dec 2013 13:31:48 +0100 Message-Id: <1387197108-24040-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387197108-24040-1-git-send-email-ulf.hansson@linaro.org> References: <1387197108-24040-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Due to the removal of the Kconfig option MMC_UNSAFE_RESUME, several validations of a present bus_ops callback became redundant. Let's remove these. Signed-off-by: Ulf Hansson --- drivers/mmc/core/bus.c | 12 ++---------- drivers/mmc/core/core.c | 13 +++++-------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 64145a3..8246448 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -185,24 +185,16 @@ static int mmc_runtime_suspend(struct device *dev) { struct mmc_card *card = mmc_dev_to_card(dev); struct mmc_host *host = card->host; - int ret = 0; - if (host->bus_ops->runtime_suspend) - ret = host->bus_ops->runtime_suspend(host); - - return ret; + return host->bus_ops->runtime_suspend(host); } static int mmc_runtime_resume(struct device *dev) { struct mmc_card *card = mmc_dev_to_card(dev); struct mmc_host *host = card->host; - int ret = 0; - if (host->bus_ops->runtime_resume) - ret = host->bus_ops->runtime_resume(host); - - return ret; + return host->bus_ops->runtime_resume(host); } static int mmc_runtime_idle(struct device *dev) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 10856ec..22427c6 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2231,9 +2231,6 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check) { struct mmc_card *card = host->card; - if (!host->bus_ops->power_restore) - return -EOPNOTSUPP; - if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) return -EOPNOTSUPP; @@ -2335,7 +2332,7 @@ int _mmc_detect_card_removed(struct mmc_host *host) { int ret; - if ((host->caps & MMC_CAP_NONREMOVABLE) || !host->bus_ops->alive) + if (host->caps & MMC_CAP_NONREMOVABLE) return 0; if (!host->card || mmc_card_removed(host->card)) @@ -2418,7 +2415,7 @@ void mmc_rescan(struct work_struct *work) * if there is a _removable_ card registered, check whether it is * still present */ - if (host->bus_ops && host->bus_ops->detect && !host->bus_dead + if (host->bus_ops && !host->bus_dead && !(host->caps & MMC_CAP_NONREMOVABLE)) host->bus_ops->detect(host); @@ -2520,7 +2517,7 @@ int mmc_power_save_host(struct mmc_host *host) mmc_bus_get(host); - if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { + if (!host->bus_ops || host->bus_dead) { mmc_bus_put(host); return -EINVAL; } @@ -2546,7 +2543,7 @@ int mmc_power_restore_host(struct mmc_host *host) mmc_bus_get(host); - if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) { + if (!host->bus_ops || host->bus_dead) { mmc_bus_put(host); return -EINVAL; } @@ -2651,7 +2648,7 @@ int mmc_pm_notify(struct notifier_block *notify_block, /* Validate prerequisites for suspend */ if (host->bus_ops->pre_suspend) err = host->bus_ops->pre_suspend(host); - if (!err && host->bus_ops->suspend) + if (!err) break; /* Calling bus_ops->remove() with a claimed host can deadlock */