From nobody Thu Nov 28 22:28:37 2024 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (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 C268A1898E0; Fri, 27 Sep 2024 11:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727435940; cv=none; b=DGd/+UPDTenQXs3ks/Cl39NbRh70M6lQs6sghAXKl+a5fPmgF8/OkRAsHUkzNt01BbO8bXQT4CKstejfkI76kotnsX3y43GM6YS7jw3OlsaWisE0U0RcPjwf+8fD15KHPbJfcQwf09BF4Cy4SDyC4xldxz26tFHcpfYwG58L0Fs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727435940; c=relaxed/simple; bh=FM7WrOl+sjXNv2gooNTszUc05pHuYbxGGq9cmTJe2Uw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hxQ9019ctjZkDfzMi9pbFFgjeVaHvdzBrW16P5wOJbm5ed+kHrATnJozIJl+BiHmdZD1Zc3aiJPw+Pkpfzv2cwj7GQnYO6eAEn6e1Jns6qb2euMewG64ecG1c71yDbOh1bEorfkpmcecKv3KRdJHBijRxjeDGBI9dVddlcfJzRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Fri, 27 Sep 2024 19:17:45 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Fri, 27 Sep 2024 19:17:45 +0800 From: Billy Tsai To: , , , , , , , , , , , , , , Subject: [PATCH v6 5/7] gpio: aspeed: Change the macro to support deferred probe Date: Fri, 27 Sep 2024 19:17:42 +0800 Message-ID: <20240927111744.3511373-6-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240927111744.3511373-1-billy_tsai@aspeedtech.com> References: <20240927111744.3511373-1-billy_tsai@aspeedtech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use module_platform_driver() to replace module_platform_driver_probe(). The former utilizes platform_driver_register(), which allows the driver to defer probing when it doesn't acquire the necessary resources due to probe order. In contrast, the latter uses __platform_driver_probe(), which includes the comment "Note that this is incompatible with deferred probing." Since our GPIO driver requires access to the clock resource, the former is more suitable. Signed-off-by: Billy Tsai Reviewed-by: Andrew Jeffery --- drivers/gpio/gpio-aspeed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 1be9a7aa9e8b..d6a35e230370 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -1313,7 +1313,7 @@ static const struct of_device_id aspeed_gpio_of_table= [] =3D { }; MODULE_DEVICE_TABLE(of, aspeed_gpio_of_table); =20 -static int __init aspeed_gpio_probe(struct platform_device *pdev) +static int aspeed_gpio_probe(struct platform_device *pdev) { const struct of_device_id *gpio_id; struct gpio_irq_chip *girq; @@ -1414,13 +1414,14 @@ static int __init aspeed_gpio_probe(struct platform= _device *pdev) } =20 static struct platform_driver aspeed_gpio_driver =3D { + .probe =3D aspeed_gpio_probe, .driver =3D { .name =3D KBUILD_MODNAME, .of_match_table =3D aspeed_gpio_of_table, }, }; =20 -module_platform_driver_probe(aspeed_gpio_driver, aspeed_gpio_probe); +module_platform_driver(aspeed_gpio_driver); =20 MODULE_DESCRIPTION("Aspeed GPIO Driver"); MODULE_LICENSE("GPL"); --=20 2.25.1