Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1968721rwi; Fri, 28 Oct 2022 01:00:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pDCNvXxq9MeuwB7D+LnXt7w7w23M3IQEm86q2cWsSbrDqAwbzNsq6E98PrMQctkFenFTy X-Received: by 2002:a17:906:4795:b0:794:8b93:2e43 with SMTP id cw21-20020a170906479500b007948b932e43mr40293890ejc.184.1666944043980; Fri, 28 Oct 2022 01:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666944043; cv=none; d=google.com; s=arc-20160816; b=pWUMD9/N8neJAeBRq320fsC9P7y3eW+EVgu16ZWe6lMRF05aTbTzu9ROniR18Yl0sP br2mFWIJwxzDVV4mwayskryl45cyv0VFphMylgRQf19Z5F/+LDzj1ZSDHM1Jhok31/d8 OpQSB8olvzdwLmfXVm/xgnxiO9rzqP3gaAlho8Qk2G5gxuSxvN6DOs33wIFSQ2wuDgp4 UFBACehMKAY3ElqnNqWtus3KvPKPFrg/uN0hCPdjAKvcWfKvFDUNFe1SpwNtaMCyJ6AQ RcNoJC4oL/TjBQcAXHIcbEkGncjGaUWx1gE5JIg9/Y0PWiJX6H48hrlRFx/my103bw/N VyJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:to:from:sender:reply-to :subject:mime-version:dkim-signature:dkim-filter; bh=CWUfsC0Pi4NZOcVC8baMUqkw1IwSaT37tR2xo1u6jBM=; b=ZoP89Z48+EuJoF2X6gSCfcAklTI1TgiSibj/hUeGTAQj2XTcUccBw/Klckzn0jPKhI cKhGgUcdfwt+qocGduDJNutAz15YRh/gR0di1gpdDlFNlsXX1kGKU/b8/vdnX0fJQuUf QCG5e63K4ZChETxHLttccPUzreRfLYrYJdPiRjOUODQTQy6nbEQf8rh1LFUX4f4WmOeD GIx28MXias07SlEsAgn0L1ImTxI/pfwhppWEinwalNJVX+RocTalKcpqnRva3dZEQF5F 6QochBibn32kBJTDm/z66CZ3Zw8rNKgcmGrM2VNitU1it2fFagCxKl1myH05UJHVDJcF 1i9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ROu4yN+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc40-20020a17090716a800b00791a4f70674si1150584ejc.24.2022.10.28.01.00.18; Fri, 28 Oct 2022 01:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ROu4yN+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbiJ1HgB (ORCPT + 99 others); Fri, 28 Oct 2022 03:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiJ1HgA (ORCPT ); Fri, 28 Oct 2022 03:36:00 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC97FA2A97 for ; Fri, 28 Oct 2022 00:35:56 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20221028073554epoutp03569f7322429f18bc0aef8725addedb3b~iK2vivW8_0282502825epoutp03f for ; Fri, 28 Oct 2022 07:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20221028073554epoutp03569f7322429f18bc0aef8725addedb3b~iK2vivW8_0282502825epoutp03f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1666942554; bh=CWUfsC0Pi4NZOcVC8baMUqkw1IwSaT37tR2xo1u6jBM=; h=Subject:Reply-To:From:To:Date:References:From; b=ROu4yN+SrVmhgT+wfkPTrFaPkiAgrHEAOfuLzbYZOo8BpbeThnt39iFt8XCfWGDXR CXnivc9mMIZ0IY96tPFWbAr3ARumdKAbd1yV4QyK13sMFUApnedd6auoXQZeTVql5Z l/Py/Xz+RlUI8poVrEDWVy9ow+apKwjsryXpKcNs= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20221028073554epcas2p36b80a5b9458e40611ac2596e43b5e1b5~iK2vIsDKS2879428794epcas2p3E; Fri, 28 Oct 2022 07:35:54 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.98]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4MzDqY4lXLz4x9Px; Fri, 28 Oct 2022 07:35:53 +0000 (GMT) X-AuditID: b6c32a46-85fff70000012ff6-a5-635b86597485 Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 57.53.12278.9568B536; Fri, 28 Oct 2022 16:35:53 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH] scsi: ufs: core: Refactor ufshcd_hba_enable() Reply-To: keosung.park@samsung.com Sender: Keoseong Park From: Keoseong Park To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , Jinyoung CHOI , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20221028073553epcms2p6dc4f8bdbebdc8f96f43fc4197b3edd0c@epcms2p6> Date: Fri, 28 Oct 2022 16:35:53 +0900 X-CMS-MailID: 20221028073553epcms2p6dc4f8bdbebdc8f96f43fc4197b3edd0c Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDJsWRmVeSWpSXmKPExsWy7bCmqW5kW3Sywaq/KhYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8XLQ5oWj24/Y7To7d/KZrHoxjYmi8u75rBZdF/fwWax/Pg/Jgce j8tXvD0W73nJ5DFh0QFGj+/rO9g8Pj69xeLRt2UVo8fnTXIe7Qe6mQI4orJtMlITU1KLFFLz kvNTMvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4COVVIoS8wpBQoFJBYXK+nb 2RTll5akKmTkF5fYKqUWpOQUmBfoFSfmFpfmpevlpZZYGRoYGJkCFSZkZyy62MFYcIuzYkr/ U+YGxo/sXYycHBICJhJ75/eydDFycQgJ7GCUePplB1CCg4NXQFDi7w5hkBphATuJozub2EBs IQElia6FW5kh4gYS66bvAbPZBPQkpvy+wwgyR0TgJ7PEpfez2SAW8ErMaH/KAmFLS2xfvpUR wtaQ+LGslxnCFpW4ufotO4z9/th8qBoRidZ7Z6FqBCUe/NwNFZeUaD2zFWp+vsSTm/1Q82sk Fmz/DBXXl7jWsREszivgK9H8ZQrYfBYBVYnlWz5B1btI3J7WBRZnFpCX2P52DjPI78wCmhLr d+mDmBICyhJHbrHAfNKw8Tc7OptZgE+i4/BfuPiOeU+YIGw1iUcLtrBC2DISF+ecg/rEQ+La hCtsExgVZyECehaSG2Yh3LCAkXkVo1hqQXFuemqxUYERPG6T83M3MYKTrZbbDsYpbz/oHWJk 4mA8xCjBwawkwnv2RniyEG9KYmVValF+fFFpTmrxIUZToO8nMkuJJucD031eSbyhiaWBiZmZ obmRqYG5kjhv1wytZCGB9MSS1OzU1ILUIpg+Jg5OqQam/BlPA65OEpiSM/9x9UN9fia/kqDy 6R+6v1w5q/fQ3C7Iz2G97sHfT4Sed76/PFUg597Rf1lS1fmvQiS2FNpUzfQS3L51a1R+ZPnK onRBk1jmDRzR13h/Oq/xMWwNvHbQc+LEXzLPci7tWSTEyXzIv95gun3JkrSp5ftPV6vFznw7 c681gy7j9atXKtqsfm/qEfnA+j4n8taXe1IXJ1qLORUuDBFZo6Bt0L5gibvUm257nYv5ETo7 O6W0N2mJcy26FODGdsb884LFmyv/T1/ZbXE987+IZQ/v3dUvX/M4xG7fM+ufw9rE3vVzPB+n Xfi39/rKN99qw0++WsXb3poiNPfeiva7vCfPVhxS7/zYrMRSnJFoqMVcVJwIALOnOBU/BAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221028073553epcms2p6dc4f8bdbebdc8f96f43fc4197b3edd0c References: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Use "if error return" style in ufshcd_hba_enable(). No functional change. Cc: Bart Van Assche Cc: Alim Akhtar Signed-off-by: Keoseong Park --- drivers/ufs/core/ufshcd.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index b2203dd79e8c..4288241040db 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4665,14 +4665,18 @@ int ufshcd_hba_enable(struct ufs_hba *hba) /* enable UIC related interrupts */ ufshcd_enable_intr(hba, UFSHCD_UIC_MASK); ret = ufshcd_dme_reset(hba); - if (!ret) { - ret = ufshcd_dme_enable(hba); - if (!ret) - ufshcd_vops_hce_enable_notify(hba, POST_CHANGE); - if (ret) - dev_err(hba->dev, - "Host controller enable failed with non-hce\n"); + if (ret) { + dev_err(hba->dev, "DME_RESET failed\n"); + return ret; } + + ret = ufshcd_dme_enable(hba); + if (ret) { + dev_err(hba->dev, "Enabling DME failed\n"); + return ret; + } + + ufshcd_vops_hce_enable_notify(hba, POST_CHANGE); } else { ret = ufshcd_hba_execute_hce(hba); } -- 2.17.1