Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp326195pxm; Wed, 2 Mar 2022 16:27:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWWPoAz9gW6TW2fN8PFVO0EFLAve+Dkl2YpQCPpOOpAmrlG1QmiJqduYqvhG7r0nyNgOPl X-Received: by 2002:a62:6287:0:b0:4e0:cf48:e6ae with SMTP id w129-20020a626287000000b004e0cf48e6aemr35320422pfb.30.1646267233402; Wed, 02 Mar 2022 16:27:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646267233; cv=none; d=google.com; s=arc-20160816; b=przJgEN1modMbsG8Xijo2ScCIup63poUEt9Ei/SHnTxdHpttlmdovJ3cMTa72rETAE jbiermzrw0A2fNAkk6FYLf5o8eKsAsj1crlNMXc7d4qIGtE4qJz+62ypzjhlu9shfkKZ AWl4IuTDz30OzabP+rU8ViFIsb58IhWOEvZ9jawRQ0nGbIH5upzjjifO9hkryCUyWpBL j04QJLvjqwUAVL3R8qWeB+PC4wUJ0q6BFTZC0iGZssBoJ2URCd0W18J0YeupgqYNnOyg Es4WsiiSijdHmShBDUAoLc3cyGHHXZX6g8mMD6zmoXpm9YGy6oSP4ddoZ/lBr9wl+Iyl lKSQ== 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 :message-id:date:subject:cc:to:from; bh=lbwkz7+ipfIbNyH7NVSe95cEArwtd+O+NJMgtKcSOkI=; b=yQZIZhn6jrJkNnt55VwdhnJhiCMOBmaMJiOcD5rZSyfWjyC9X3Ubb/jvGoYCdWB+iZ xK4gMZQJ7cHWY4mmgxs7tZD1kt1ZIGggv7tB+m6MONwK4YQBJMQ7Um7DJV9YVW1Rv6fN 3xK+VBSt0RzFmm2sb8mzQWvKcpPmOEKO8woRx70nZodHo8OqDVEzbn1Srt+DzhTWWAHE cLUpMW5f3Vtgt7kg8IGbZ9K9Z4JR6jhq6Egoa3SklYWO49L/RUgFB8VqjXJMYw/JYyEg fn9+4F+ZyKiNRPhSySxg3gMPM9BajPwypfG92SPk5EqtymahkK5ESYRZ7RhmN+4iS+qX alpw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e19-20020a656bd3000000b00378c34a2b04si518550pgw.328.2022.03.02.16.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:27:13 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 53B28163D49; Wed, 2 Mar 2022 15:39:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240410AbiCBJVp (ORCPT + 99 others); Wed, 2 Mar 2022 04:21:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240400AbiCBJVj (ORCPT ); Wed, 2 Mar 2022 04:21:39 -0500 Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3C1D6B6D0D for ; Wed, 2 Mar 2022 01:20:55 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-05 (Coremail) with SMTP id zQCowACXefL0Nh9iViXtAQ--.26036S2; Wed, 02 Mar 2022 17:20:52 +0800 (CST) From: Jiasheng Jiang To: broonie@kernel.org, michal.simek@xilinx.com Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] spi: spi-zynqmp-gqspi: Handle error for dma_set_mask Date: Wed, 2 Mar 2022 17:20:51 +0800 Message-Id: <20220302092051.121343-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowACXefL0Nh9iViXtAQ--.26036S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtr45GF45CF45Xry8JFW8WFg_yoWDJFg_Cw 47ZFn5Grs0v39Fy3Z7Kry3AryqvrZ8ZF4UZFWkKa1FqrWDJr9xZayUZryxCr10v3y7urs3 Cr1jq3ykAr13WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb48FF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_GFWl 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7VUjItC5UUUU U== X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the potential failure of the dma_set_mask(), it should be better to check it and return error if fails. Fixes: 126bdb606fd2 ("spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails") Signed-off-by: Jiasheng Jiang --- drivers/spi/spi-zynqmp-gqspi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 328b6559bb19..2b5afae8ff7f 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -1172,7 +1172,10 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) goto clk_dis_all; } - dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + if (ret) + goto clk_dis_all; + ctlr->bits_per_word_mask = SPI_BPW_MASK(8); ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS; ctlr->mem_ops = &zynqmp_qspi_mem_ops; -- 2.25.1