Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp414700rdb; Thu, 8 Feb 2024 09:21:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUPqc+CP6TVHB5SnARGDOGPPNS4aXdd71Or9ylkKFSM2Fyn5CdFR207AWzhYWyE9DPpKmH1b6uZEjy9cAFX0G3Y3baCBxf+R93QB3lFvQ== X-Google-Smtp-Source: AGHT+IE6pPmmG5FrCjBa+00BnhSpkmqpxO+apeR5PtU2o2W+gHBwXP8Z8C5Ucr5gNoPyF37ELreD X-Received: by 2002:a17:90a:bd8a:b0:296:f874:6846 with SMTP id z10-20020a17090abd8a00b00296f8746846mr2498221pjr.36.1707412888112; Thu, 08 Feb 2024 09:21:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707412888; cv=pass; d=google.com; s=arc-20160816; b=duMmnvyPWfNECYphx8M+SsRiztp4VzmupP8JsCZn4IWZIVOjObWdYab/Kr08IcbjQt 6gCh424d1J8BB97/OBMLNB1Rt4Rv00uox7v4gRTgffhCK4plN80qc+6Sg99PsbB6eJRn wuy7GFEl1Jz/3I+iyejXxQC9nZt2xZaj/FnYws+m0Bk/wVzCv+/foVwhtxjYNm/xkr1V On05cRFk1r3sMAoSZqh93jaZG2dTGbfnI/2RaIpk8a6mwB/lE8Ral0bnOlUkX/DdKg/B mfgZM95BJe/1+ZexMAIahFMaebiXTIv9f2FCCPcJir7OdxqOFCQDLR15JSmCYX7pc1Cr +n7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=awh4L/FvuKTUk4LCovxuQcQcm/YmAlMhgCuKLpIU3pA=; fh=oZ8fC9JKAOIrICXmQnJPIzxKdnrfeTbDsW4H7CJcJnk=; b=PS3CtfKKF9+Zi3GoZ+ypvUOgJ9im2kRhCMHipoGRyOaTCeIM4SBfoPxIpPFU32b53A 9QY1pDf4Amw3OWfHUJe8dOUZEm5OZer6qA4q4bRmil4+LpgY+xVEnv5E3SUZ1EqYMHxs v2eECuTpAwpJ0OnHO18oJNqjqjRFEMJx89mi9dCGvgp1BHNnM5ROoDTZmvQYKvJ44+dU c+YFJtHVu9A1hqsHjsVJaTZ9P+/eWe+HXi3CUY0DVvzHYhkCTsQH+FC+VxtilTCZm5vi YyS1GpzcEkkEmi1UFy16yjAXcg7txcNuevpT+rTwv3Zay+TGsuwnoCWNpzeZCTYWJBu8 tCSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kcj8dII9; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCWEdjrq9yq6R6uJIyeiuR4t4y6n/wd/TtUyDUCADINOIn3XXXoItEJAnIOi4g03hOFijlKrf9yvxNxHNdmx0K8McuWblWDAKc255ve5Kw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id px5-20020a17090b270500b002953a1e7e33si1143579pjb.164.2024.02.08.09.21.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:21:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kcj8dII9; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58401-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BF28B22226 for ; Thu, 8 Feb 2024 17:04:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9F8D81AD7; Thu, 8 Feb 2024 17:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="kcj8dII9" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A2FA77F33; Thu, 8 Feb 2024 17:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411870; cv=none; b=sUPZfsf8VKtxZrVEUw/5NEb9HCk3SCedNEO3PvqMkxEsedOLFhO+j6aRfIOtD9+5n30Fy8bOYuMjpU6BtK/kjqoeZb6ps+0G8RiY/STgYmTS54m98iEL+lGolXrQQUfq560b8qk3lTdYo5Quw43Yno4OPpT+nMuUDfgmP8LyyUs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411870; c=relaxed/simple; bh=cM1cFjnSzQs76i3u0egboaHOZ+8JvQ6u6lgJc80Opuw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z+bfqvmWGMmI/pMGLAXFTYmEfYLRc+f+KkRunOlrTJ2zoe2jgEmthqjr8Qe0iA4GN+HSoGJRKLRChfStqMZmVoCDV50OO6/xWCC5UcNJrsVgYjDoeDax8IdcqpB5S0Y1cd8BsvTaKb+aquD8MbvmlPmd3SmIe+sCc4lyOYmD22o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=kcj8dII9; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418H4G01051761; Thu, 8 Feb 2024 11:04:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411856; bh=awh4L/FvuKTUk4LCovxuQcQcm/YmAlMhgCuKLpIU3pA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kcj8dII9QoOlZVJGFigZCr9UIY50auj4ATVfaBhVmO84SjDZC5UAyju7eTilQ21Ft szYI7O5h67Lbsvt4UztSC/YbYjHIcw9PnXTWs97NhHmBM2HvKP7jzDjoBAqmnzJfsh DGtm4g+bbhEWmdFNgaLPj1ws3uZbFhhSMxFLk+mc= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418H4GSo054075 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 11:04:16 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 11:04:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 11:04:16 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418H4B68091006; Thu, 8 Feb 2024 11:04:15 -0600 From: Andrew Davis To: Sebastian Reichel , Manivannan Sadhasivam , Cristian Ciocaltea , Florian Fainelli , Ray Jui , Scott Branden , Bjorn Andersson , Konrad Dybcio , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , , Andrew Davis Subject: [PATCH v3 06/19] power: reset: tps65086-restart: Remove unneeded device data struct Date: Thu, 8 Feb 2024 11:03:57 -0600 Message-ID: <20240208170410.67975-7-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208170410.67975-1-afd@ti.com> References: <20240208170410.67975-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 We only need one member of the struct tps65086_restart, pass that tps65086_restart_notify() directly. Remove that struct and its allocation. Signed-off-by: Andrew Davis --- drivers/power/reset/tps65086-restart.c | 35 ++++++-------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/drivers/power/reset/tps65086-restart.c b/drivers/power/reset/tps65086-restart.c index 82d7a761a0385..6976dbcac74fa 100644 --- a/drivers/power/reset/tps65086-restart.c +++ b/drivers/power/reset/tps65086-restart.c @@ -9,19 +9,14 @@ #include #include -struct tps65086_restart { - struct device *dev; -}; - static int tps65086_restart_notify(struct sys_off_data *data) { - struct tps65086_restart *tps65086_restart = data->cb_data; - struct tps65086 *tps65086 = dev_get_drvdata(tps65086_restart->dev->parent); + struct tps65086 *tps65086 = data->cb_data; int ret; ret = regmap_write(tps65086->regmap, TPS65086_FORCESHUTDN, 1); if (ret) { - dev_err(tps65086_restart->dev, "%s: error writing to tps65086 pmic: %d\n", + dev_err(tps65086->dev, "%s: error writing to tps65086 pmic: %d\n", __func__, ret); return NOTIFY_DONE; } @@ -36,27 +31,13 @@ static int tps65086_restart_notify(struct sys_off_data *data) static int tps65086_restart_probe(struct platform_device *pdev) { - struct tps65086_restart *tps65086_restart; - int ret; - - tps65086_restart = devm_kzalloc(&pdev->dev, sizeof(*tps65086_restart), GFP_KERNEL); - if (!tps65086_restart) - return -ENOMEM; - - tps65086_restart->dev = &pdev->dev; - - ret = devm_register_sys_off_handler(&pdev->dev, - SYS_OFF_MODE_RESTART, - SYS_OFF_PRIO_HIGH, - tps65086_restart_notify, - tps65086_restart); - if (ret) { - dev_err(&pdev->dev, "%s: cannot register restart handler: %d\n", - __func__, ret); - return -ENODEV; - } + struct tps65086 *tps65086 = dev_get_drvdata(pdev->dev.parent); - return 0; + return devm_register_sys_off_handler(&pdev->dev, + SYS_OFF_MODE_RESTART, + SYS_OFF_PRIO_HIGH, + tps65086_restart_notify, + tps65086); } static const struct platform_device_id tps65086_restart_id_table[] = { -- 2.39.2