From patchwork Mon Feb 12 16:28:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 199895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp29069dyb; Mon, 12 Feb 2024 08:31:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXd9fQM3HGdHK2l+SUcvidwm/83XYjAUpVL50Q4kVXGuKdbCHIGzxhrzvGmu66/U4bQvZTwWzOqUPmy66DFsEGD6Fx7lA== X-Google-Smtp-Source: AGHT+IFuQfxgcMDFkyavK7m0XvOU/3ke9ihR+u6BqPM42hvbyE3dKNctbWwVfpwhZAOWHshnEToP X-Received: by 2002:a17:906:f1cb:b0:a3c:b059:9176 with SMTP id gx11-20020a170906f1cb00b00a3cb0599176mr1676159ejb.70.1707755518689; Mon, 12 Feb 2024 08:31:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707755518; cv=pass; d=google.com; s=arc-20160816; b=woMZ1GwY6+6/NHMEmc+9c3r5J5GW0MdRZP7kbPQkVXIcGIl8Jsf9jeHxQutqvjGkhT 6vneSemPALjbQroEAeyRidNESsAY9tSJKCZJxDAEc+bBhG386wi1hVoWCuxx81EZge+Q 6vzSmjbTQpZsRwMnZXivpUZdq1Aq3HEoZGOnjQo1PHJs4kSEkxzuWBKpx2nDkteR71Wr AJXd4NSew/WkK1/S89Kg8OpzsnoShN+DE4ooIkCygnbYkiOxQZLLD/Az9Dc74JiAxlQQ sVSIeUjsf8lv8Q6fhhfflomiltwkMZLeoC/WMp70NTWkcRiIOXwPyCsPx2cAXrgdACkF LhTw== 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=4i9OymHp0oIMCfVJhkSKrU243+oEzJEk9U/gQPH25pU=; b=aoPNjjb0vwTmeZwYrQgxqVI0kx/tIkeVI8TbKmJC0SlSfsVAwdII+0ff0+CnYAEpz5 Y7i+Gxapj/Df/fm/p4Z4T6BuPtuts1ibTSRVnRC08SGaLqPIV6YNZ7DSAgTBVKAzaxvQ DR2nPMD6Z5bWeqGi6GLLGKBojiyx0UK2jJhyCw+NJ3GbEgiGwThanpEcsUQE9IDBWbdZ vAhXgKg/Tmk4lsUABYfX8y95lvcNWPZEIwfKvaDmQljE+p48Dz2XBCYQdqEScf3jKzXo 32MY+duIg7lHAbdDBGPX4Uyfw89ma8h9PcnlWn8vwCl90s6t63mmWrQG0qv+3rXYDbS0 jQyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KhuSzMZZ; 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-61961-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61961-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCWvIT74u5UaNEA0CM0046fbHazjWhOvt9+dWgDqDZooAr6ie9xWcvowzp6iOrKVqtZEGNh6/EPCFWA5rHbP0/UzWWVtkw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h5-20020a1709062dc500b00a379d8d3356si319334eji.818.2024.02.12.08.31.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:31:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61961-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KhuSzMZZ; 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-61961-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61961-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4F94F1F224C0 for ; Mon, 12 Feb 2024 16:31:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 186CC46425; Mon, 12 Feb 2024 16:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="KhuSzMZZ" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 2B3F73D547; Mon, 12 Feb 2024 16:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755329; cv=none; b=X/ko19/bWOUtp6IfG2uZTiRatoCD0BJNdyVEdSnr/bYg0RwWUTwbWap+Bpp0Gv/71qHcaZYn+t/tBDSSli1ttfz2WZELr0Mg1vvXijMbNAI6fd1uFetlSNAUNJnq0jcGqIzSdxQbTPh6jLUETMhmCdHqBtdl764dMlBFcdwLbks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755329; c=relaxed/simple; bh=cM1cFjnSzQs76i3u0egboaHOZ+8JvQ6u6lgJc80Opuw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AavhmC3rqduI5O6MeyNLiubp7JbAccjqJBiTcpXkZnSGVBcCX21hTMg8TGbLTwMko5NboCrHl5oonXiQbJfuJquT3PT5uxRVHgQkzyqmO2vs5xi0BCAkaA4BJX1bSIAImrku6PkAau9bB1B8x8Y30CmJBRNbPsr18eEEvXSiNb0= 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=KhuSzMZZ; arc=none smtp.client-ip=198.47.23.249 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 lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41CGSbjh004152; Mon, 12 Feb 2024 10:28:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707755317; bh=awh4L/FvuKTUk4LCovxuQcQcm/YmAlMhgCuKLpIU3pA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KhuSzMZZYFT9Ke/54Lqtd9TYN3hzuoQkiUVlJ2lrixh98IkZwXcgQvD8PZ+sqkVwv XcyRVSoiFslc7QvGR/xbaGtbD+AzPY4tk3fqkoFnijfXcZ1Wrf+MUI4Ut3P3lpee2N lBq15gp2HugbTofud/HgeBujqU7ml9dr56lCv91o= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41CGSb6v024867 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 12 Feb 2024 10:28:37 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) 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; Mon, 12 Feb 2024 10:28:36 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE112.ent.ti.com (157.170.170.23) 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; Mon, 12 Feb 2024 10:28:36 -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 41CGSWR2090688; Mon, 12 Feb 2024 10:28:36 -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 v4 06/19] power: reset: tps65086-restart: Remove unneeded device data struct Date: Mon, 12 Feb 2024 10:28:18 -0600 Message-ID: <20240212162831.67838-7-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212162831.67838-1-afd@ti.com> References: <20240212162831.67838-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790711450624001875 X-GMAIL-MSGID: 1790711450624001875 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[] = {