From nobody Mon Apr 6 00:09:58 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B92EC54EE9 for ; Tue, 13 Sep 2022 08:41:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbiIMIlb (ORCPT ); Tue, 13 Sep 2022 04:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbiIMIlH (ORCPT ); Tue, 13 Sep 2022 04:41:07 -0400 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06BFC1E3F5 for ; Tue, 13 Sep 2022 01:41:03 -0700 (PDT) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28D88iXB007635; Tue, 13 Sep 2022 01:40:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PPS06212021; bh=UDsHn+9Q4/Sb44o7PGK24bSEg208rNW403NXgpY8lDE=; b=bG8XvUx2kRU1NezMtCDLmeiDknljQmkek+28NZ+9QUlOc59/TVphcTUhrEWRqy7WXhuY ALjqBhIt1d/IaemuryxqQLS6ZwX6SoW8piAEkRZ37oNY8fhFT0zZ7CEKZxj+PAUOP08f NwcDYo/EmWd2CBqSlaVLz7KZMvW2A+Df4qzmw0oO638+gsY3FWy89JMIvgcFciaZBXoo BpHIGYdnQ00JnfD79lD6rci0QzjgWB+D0pS6MLkhRCOT26WYZrGP6mPEn/7x2mMH2hVY cWwa6AUftwLV6BAov90puZSJRnXyNj183hCH9d0IpyDKW/5M2yCqLgTznpK/iC2SbuPA ew== Received: from ala-exchng01.corp.ad.wrs.com (unknown-82-252.windriver.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3jgnv6at2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 13 Sep 2022 01:40:26 -0700 Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 13 Sep 2022 01:40:25 -0700 Received: from pek-ywang12-d1.wrs.com (128.224.32.146) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Tue, 13 Sep 2022 01:40:24 -0700 From: To: , , , , , CC: , Subject: [PATCH] mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt Date: Tue, 13 Sep 2022 16:40:23 +0800 Message-ID: <20220913084023.2451929-1-yaliang.wang@windriver.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: uQ_sJLHkaE_jWWPTxhnn7fO7D111R8Mt X-Proofpoint-ORIG-GUID: uQ_sJLHkaE_jWWPTxhnn7fO7D111R8Mt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_03,2022-09-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=919 mlxscore=0 spamscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130038 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yaliang Wang When utilizing PARSE_SFDP to initialize the flash parameter, the deprecated initializing method spi_nor_init_params_deprecated() and the function spi_nor_manufacturer_init_params() within it will never be executed, which results in the default_init hook function will also never be executed. As we do have quad enable function defined in BFPT, the post_bfpt hook will be the right place to tweak the function. Cc: stable@vger.kernel.org Fixes: 047275f7de18 ("mtd: spi-nor: gigadevice: gd25q256: Init flash based = on SFDP") Reported-by: kernel test robot Signed-off-by: Yaliang Wang --- drivers/mtd/spi-nor/gigadevice.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/gigadevice.c b/drivers/mtd/spi-nor/gigadev= ice.c index 119b38e6fc2a..bdc4d73424af 100644 --- a/drivers/mtd/spi-nor/gigadevice.c +++ b/drivers/mtd/spi-nor/gigadevice.c @@ -8,19 +8,24 @@ =20 #include "core.h" =20 -static void gd25q256_default_init(struct spi_nor *nor) +static int +gd25q256_post_bfpt(struct spi_nor *nor, + const struct sfdp_parameter_header *bfpt_header, + const struct sfdp_bfpt *bfpt) { /* * Some manufacturer like GigaDevice may use different * bit to set QE on different memories, so the MFR can't * indicate the quad_enable method for this case, we need - * to set it in the default_init fixup hook. + * to set it in the post_bfpt fixup hook. */ nor->params->quad_enable =3D spi_nor_sr1_bit6_quad_enable; + + return 0; } =20 static const struct spi_nor_fixups gd25q256_fixups =3D { - .default_init =3D gd25q256_default_init, + .post_bfpt =3D gd25q256_post_bfpt, }; =20 static const struct flash_info gigadevice_nor_parts[] =3D { --=20 2.34.1