From patchwork Mon Apr 8 12:19:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2408291 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8E04BDFE82 for ; Mon, 8 Apr 2013 12:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935592Ab3DHMWx (ORCPT ); Mon, 8 Apr 2013 08:22:53 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:55150 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935127Ab3DHMWw (ORCPT ); Mon, 8 Apr 2013 08:22:52 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r38CMoI9013608; Mon, 8 Apr 2013 07:22:50 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r38CMo6h006355; Mon, 8 Apr 2013 07:22:50 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Mon, 8 Apr 2013 07:22:49 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r38CMnXR013128; Mon, 8 Apr 2013 07:22:49 -0500 Received: from localhost (h68-18.vpn.ti.com [172.24.68.18]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r38CMkV03419; Mon, 8 Apr 2013 07:22:47 -0500 (CDT) From: Eduardo Valentin To: CC: , , , Eduardo Valentin Subject: [PATCH 8/8] staging: ti-soc-thermal: fix device removal Date: Mon, 8 Apr 2013 08:19:14 -0400 Message-ID: <1365423555-2669-9-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c In-Reply-To: <1365423555-2669-1-git-send-email-eduardo.valentin@ti.com> References: <1365423555-2669-1-git-send-email-eduardo.valentin@ti.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org While removing, the device needs to unregister the sensor from thermal framework. Before calling the call back the driver needs to check if the call back is registered. This patch fix the check by checking the right callback. Signed-off-by: Eduardo Valentin --- drivers/staging/ti-soc-thermal/ti-bandgap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c index 37fdba6..f20c1cf 100644 --- a/drivers/staging/ti-soc-thermal/ti-bandgap.c +++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c @@ -1369,7 +1369,7 @@ int ti_bandgap_remove(struct platform_device *pdev) /* First thing is to remove sensor interfaces */ for (i = 0; i < bgp->conf->sensor_count; i++) { - if (bgp->conf->sensors[i].register_cooling) + if (bgp->conf->sensors[i].unregister_cooling) bgp->conf->sensors[i].unregister_cooling(bgp, i); if (bgp->conf->remove_sensor)