Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3694391pxb; Mon, 24 Jan 2022 15:34:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvhChgvoxpQ2x+USYEcxhwVH3CdXByicKY++unDqDNewe9YkYqp/vVe7N6+/HaPbV+xEu8 X-Received: by 2002:a05:6a00:190a:b0:4c3:a8f8:1e4c with SMTP id y10-20020a056a00190a00b004c3a8f81e4cmr15874675pfi.69.1643067267610; Mon, 24 Jan 2022 15:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067267; cv=none; d=google.com; s=arc-20160816; b=stG+G0smRZuW2AMrJZi5eXvUrQS4ynknDZJ9a1fsT/B7mlSXSp6dX5r8Q/ydIDYdPv sRCH3a/ePF0cbfBY/3dE4ZKFS89AsAI0hXfJDGqESDdzyWjlsq0Oe/5o11rbQyCsrrB/ o5THyphAuTRd2nR82d4wGGOjeLDXqzH0C7EpKVOkf6Jd702MFc/zyn96tj469PxjXo92 ehOm0XOMRg1LyBS0hBtW0ZlMP9hF7ZcnqM8X9g8MCXE9Jd49yXiy5ukXGifu4btdCRu0 9cSaQpD6uKjJalZthmNjGSRbjkV3i7j5ROFWAi/78qYBol3sGwAFqmZNDrh8wie5BmiD tESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6i9Wv1JXh1+qMflwvmLmSbFPEcE/FmV3cWkxIjJVRCE=; b=0mXmsJAgWyaUv87FSEiYoU562hzyKGVLeujwL+03kWtYCv/tqeD7GN/evN5bRUtj/b kpKGFT4Xi1wI2+n/yByiJFtotnIkGmPdiE/tZQzQbyoqhTuj8HrimRd4kNxIIa94EGWi 3+R89y9LPkiyOT4P32leUJxYMugZvST5S8knmYp3H9lycX9RSd/a+qXoZuzBKEAR/z2o 1XdRWtZ9Df49dwyDxyRMW6FKOYy5UNfCb9mTi9n3cjC1aHTDbeBXCUmpwecBtsiw1oo9 Pzy6tMVXxWXB1W35ZyxRhzL4uXxENZF3rGh/G3botSqoKjk9HgwK2bOlzqkaF6ACXx6b aO1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=drLiPG9n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id il7si807185pjb.19.2022.01.24.15.34.16; Mon, 24 Jan 2022 15:34:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=drLiPG9n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385610AbiAXX2z (ORCPT + 99 others); Mon, 24 Jan 2022 18:28:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449711AbiAXWNN (ORCPT ); Mon, 24 Jan 2022 17:13:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 663D6C0E03DA; Mon, 24 Jan 2022 12:43:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03CB7608D4; Mon, 24 Jan 2022 20:43:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8245C340E5; Mon, 24 Jan 2022 20:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057025; bh=9YkuKF8cpwuIWjIHtOGRypGioyQeoLf8mYpkm6MpMf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=drLiPG9n0JHGsbnpMizRpGZmY2JMmgcsLq1egMsnE7xzKI+25+DMpcej5n4x+ChIB JGKGWiYGoPgqABDoQO+AnuQ7xy7JQadLLM/PPiu17FBa+GoE95X9M9x+A9B3IWsN3e vNaD4KEc6Hfp/7LTE+f42z+GhXd37Ky/v48wyJng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunihiko Hayashi , Mark Brown Subject: [PATCH 5.15 676/846] spi: uniphier: Fix a bug that doesnt point to private data correctly Date: Mon, 24 Jan 2022 19:43:13 +0100 Message-Id: <20220124184124.389805122@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kunihiko Hayashi commit 80bb73a9fbcde4ecc55e12f10c73fabbe68a24d1 upstream. In uniphier_spi_remove(), there is a wrong code to get private data from the platform device, so the driver can't be removed properly. The driver should get spi_master from the platform device and retrieve the private data from it. Cc: Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1640148492-32178-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-uniphier.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c @@ -767,12 +767,13 @@ out_master_put: static int uniphier_spi_remove(struct platform_device *pdev) { - struct uniphier_spi_priv *priv = platform_get_drvdata(pdev); + struct spi_master *master = platform_get_drvdata(pdev); + struct uniphier_spi_priv *priv = spi_master_get_devdata(master); - if (priv->master->dma_tx) - dma_release_channel(priv->master->dma_tx); - if (priv->master->dma_rx) - dma_release_channel(priv->master->dma_rx); + if (master->dma_tx) + dma_release_channel(master->dma_tx); + if (master->dma_rx) + dma_release_channel(master->dma_rx); clk_disable_unprepare(priv->clk);