From patchwork Tue Aug 23 15:01:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9295783 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F84760574 for ; Tue, 23 Aug 2016 15:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4006B2891A for ; Tue, 23 Aug 2016 15:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34ECA28C92; Tue, 23 Aug 2016 15:01:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C73C02891A for ; Tue, 23 Aug 2016 15:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753017AbcHWPBz (ORCPT ); Tue, 23 Aug 2016 11:01:55 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34118 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbcHWPBz (ORCPT ); Tue, 23 Aug 2016 11:01:55 -0400 Received: by mail-pf0-f195.google.com with SMTP id g202so8441036pfb.1 for ; Tue, 23 Aug 2016 08:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fALmb1XV0Tb8hqI36eA/4VrsAY+zzVO0zD8nTGGcrUA=; b=qN6Vm3ovTFggyQsLjLF7+3TQsxiwq5izmuudw063Fea0wBf3fw7AjRh1CvEEGu8vBZ iqk35q2H9wzb8Pu92vDXzIRyI/Nu3E4Im51YwgfBoJBgFn6toyVGKpFricWS2VfWZlR3 wVNVbd43X8X3z9b86O8+gUwYcZcbd03Ivm8AoVpkbZxqLT79wQ4uNU8HYVH0CTp5U24c AldLd/hEj3mSqiADIEkRgl9DmFW44y5rFcrPEv94k6iNwjJh7GTXay4eRNkE6POc5uVn 6MlKdWPlLbL/khS2MKddakcjgZ+m3W2G9jisGWjTbXfLLxEWsy3I/7UvAXGTfXiTjXXe t6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fALmb1XV0Tb8hqI36eA/4VrsAY+zzVO0zD8nTGGcrUA=; b=P/Od/pGCcnZMv9/VCaHOdArzYf/4uCD4MQV2LEyIaz+u3yxHd2N5bdOGxGslfH1aPH l3szI7nblziPYvTrZgqqv6N/LP+u41JuJ3WZdctZki1r+KZemeqS1GpWDVmbpVBxMuB3 N/PX4xj4B+FuhLg1c1NvVXPc0lzXMVJVlEi0rbwPcYIjn1T+DXgllwrJMTaiROx80L/3 U5QJeZoFem8unQv/cdojG9J/8UyeAMa5/u+4YewkwqtttkK/UxnBg3OfFgzlcwnKfMez 5HEiHF/yYMmFYdGOO6LzBs+8CpwDwnRwBkDGQufb3v/wNkNBJB3H4DSPDWkSJCpQHATR Lr9g== X-Gm-Message-State: AEkoousfMRa4QzoF9b3cDE66OG3k7wIDFbHfbbYZ61UlF9VOOxfZmVpjap2WsiZWS7eQSw== X-Received: by 10.98.138.153 with SMTP id o25mr53942227pfk.80.1471964514148; Tue, 23 Aug 2016 08:01:54 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id ty6sm6525289pac.18.2016.08.23.08.01.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 08:01:53 -0700 (PDT) From: Wei Yongjun To: Zhang Rui , Eduardo Valentin Cc: Wei Yongjun , linux-pm@vger.kernel.org Subject: [PATCH -next] thermal: qoriq: Remove unnecessary platform_set_drvdata() Date: Tue, 23 Aug 2016 15:01:28 +0000 Message-Id: <1471964488-28313-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Wei Yongjun --- drivers/thermal/qoriq_thermal.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 644ba52..d01eca0 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -217,15 +217,13 @@ static int qoriq_tmu_probe(struct platform_device *pdev) data->sensor_id = qoriq_tmu_get_sensor_id(); if (data->sensor_id < 0) { dev_err(&pdev->dev, "Failed to get sensor id\n"); - ret = -ENODEV; - goto err_iomap; + return -ENODEV; } data->regs = of_iomap(np, 0); if (!data->regs) { dev_err(&pdev->dev, "Failed to get memory region\n"); - ret = -ENODEV; - goto err_iomap; + return -ENODEV; } qoriq_tmu_init_device(data); /* TMU initialization */ @@ -254,9 +252,6 @@ static int qoriq_tmu_probe(struct platform_device *pdev) err_tmu: iounmap(data->regs); -err_iomap: - platform_set_drvdata(pdev, NULL); - return ret; } @@ -270,7 +265,6 @@ static int qoriq_tmu_remove(struct platform_device *pdev) tmu_write(data, TMR_DISABLE, &data->regs->tmr); iounmap(data->regs); - platform_set_drvdata(pdev, NULL); return 0; }