From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEB1E606A31A for ; Wed, 2 Dec 2026 16:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=s32OUBBF; dkim=pass (2048-bit key, unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=pCq5PYQc; dkim=pass (1024-bit key, unprotected) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=no3M7J7z DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=hHrRRzkkvNbUIlHaNUF2LO2lYiq/s3tARn9GsWX2F6Y=; b=s32OUBBFaPBDhM k1pWQhlzgUKITqZ73VD/xmUyAZ81e0v5pIvvqQyWqEAR56B3fvX82W1Fa9IXaCrLWvqXgjvtj3rFh my4QSbXwfP/svCr/QX7Og/ojUFeNFi+GPLfP5mNLm4lG04YalrxDrfk02AKGNR9s7GM4QFN0HYB+b fQkLKuNmbXQht0BlJKl1TDsJaiHzCAXw1aCOixCZaubHcSelpFKxhFwCMASXfySb5XN/2CDag/xBp 5VVqvklJ+KD+U1Tg6BNawXZ8ZgajJIfohhZpsJZw0xupPKUQj12ywq/i8Ilsh0eObfR2FOK+vnbjy w0GxaSputnG49NNAIXDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYlz6-0000000BsWe-3kiL; Wed, 02 Dec 2026 15:11:04 +0000 Received: from mx0b-0002e601.pphosted.com ([148.163.154.28]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYlz2-0000000BsPZ-1mXj for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 15:11:03 +0000 Received: from pps.filterd (m0374955.ppops.net [127.0.0.1]) by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2ERmOF3684291; Wed, 2 Dec 2026 09:10:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=hHrRRzkkvNbUIlHaNUF2LO2lYiq/s3tARn9GsWX2F 6Y=; b=pCq5PYQc4B4AAS7/acW/jermeawRatnGoESOL43V1/8ncDjddwOPS+oKg IbB3rLh09bq0q4mTX53kJ5IVWiX6JmGmPwWbQ9g2MHTnwJrcE7gZoGmEVl1Mt9h3 X91eMdY9vKH6AjFtYjukWmPmD2LiyRHwH6ImY6gzkT90nm+KpZyqG9Hg/58M11E4 csc7Z43Z4dVPvwKPOVvr4Is8SgQ1dOd5vqMP6etlDhHmw2gdzj63ImFN44I3u+xC nIpLeR51sTiRXhAioNeDK93Qf+UWXKqkSJOUK/e5x6wbsKNZbsuADcDnOMq6vxsL 5k6Ub3zFOr+20LujCeU/hTO39TDfg== Received: from sn4pr2101cu001.outbound.protection.outlook.com (mail-southcentralusazon11012008.outbound.protection.outlook.com [40.93.195.8]) by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4jagk31s09-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 09:10:41 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bIG4jKQMF1T3n4sYptOUhJ0899NBpByO2z/dg9vAQj55ffujpxCh72YdURWcB1KpPTBZuzylxvb8MocYCI8+PfHzYbi2wcROF8TGVxHNYLJTnjPuNhexfcn6CurdpMrBP/Z4gIEX9Hv10SzrvSGKpxK7wbvLysgbV0+Z9jvYsusYIeJNgAXoeBny1yyqSVt57pBBrSivnwijvtIeF26hbz2gRmvLy1mzRDhMVK5/xtsJOoafDGWvX0BTess+6nezxViVUh4VM7vOfajuuefTN6cPMs9wBOQuC6CbizAp/v1JxzHdn5g8+C93v2VdsC2pYiQvGQDpAQdIAJ9BkfQ/8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hHrRRzkkvNbUIlHaNUF2LO2lYiq/s3tARn9GsWX2F6Y=; b=xcOS1kWJES9+wmNSLAFi9VsXDMI+RDHInyrHFNsLCe1c/EPERrkRhsT9p1TXlO0hg4L3SDDByz7xw6GSco6llTYDaGPwW9VjATq9zkckPUV3OVHOR0GDqnWf68AK3jNgnmGGtMVK/lz+LXScCUDSjiMgVRjp7DcYJibonr5QooIhWs+MQ+S6smaHGihtCedWbbm10U/3aHeVrajZPzOPAQrwXEfsRow/vF/kFrx+bkhdlEjzMhgOWJnmnYZAwFTMLg2MwSvPTS5uPsaegtZxE3M8K9zYUAtwZlAO1z9Nz8nqkwzk3h+dAOPsPc0M19ra582eQtrFberedOyAyCOeMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hHrRRzkkvNbUIlHaNUF2LO2lYiq/s3tARn9GsWX2F6Y=; b=no3M7J7z8Akvi5R0yiEZozS0rzVRPfy6i3I998z0Dx2UZsVVkBz8+AaKXXBN4c/cLnN1+1kQqXRJ7orzhyk62Lj3C4ySYGUVimWk+XTMOshkFy5cfOxSwT+lGKEcdfWc72rpoSSbUjU8Tfa1emIbhdF0O5wZ+2v3emEW2usBos0= Received: from BN0PR03CA0019.namprd03.prod.outlook.com (2603:10b6:408:e6::24) by MN2PR10MB4352.namprd10.prod.outlook.com (2603:10b6:208:1de::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Wed, 2 Dec 2026 15:10:40 +0000 Received: from MN7PEPF00000151.namprd04.prod.outlook.com (2603:10b6:408:e6:cafe::82) by BN0PR03CA0019.outlook.office365.com (2603:10b6:408:e6::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Wed, 2 Dec 2026 15:10:40 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by MN7PEPF00000151.mail.protection.outlook.com (10.167.254.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 15:10:38 +0000 Received: from DFLE207.ent.ti.com (10.64.6.65) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 09:09:47 -0600 Received: from DFLE206.ent.ti.com (10.64.6.64) by DFLE207.ent.ti.com (10.64.6.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 09:09:47 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Wed, 2 Dec 2026 09:09:47 -0600 Received: from [10.249.36.63] ([10.249.36.63]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6B2F9kL91642547; Wed, 2 Dec 2026 09:09:47 -0600 Message-ID: <82aa77a6-b777-46df-a6ab-4355edc963e8@ti.com> Date: Wed, 2 Dec 2026 09:09:46 -0600 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 09/22] firmware: ti_sci: Fetch info struct from handle inside ti_sci_do_xfer() To: Sebin Francis , Beleswar Padhi , , , , , CC: , , Praneeth Bajjuri References: <20261029181147.266771-1-b-padhi@ti.com> <20261029181147.266771-10-b-padhi@ti.com> <589b512c-e2a3-479a-8f8a-079809feb7fd@ti.com> Content-Language: en-US From: Andrew Davis In-Reply-To: <589b512c-e2a3-479a-8f8a-079809feb7fd@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN7PEPF00000151:EE_|MN2PR10MB4352:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a967edf-55da-4769-4c76-08df50866c84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|23010399003|36860700016|82310400026|376014|56012099006|10067099003|261026140227099003|261026121527099003|261028144727099003|261021121427099003|261021123027099003|261102123227099003|261022105027099003|261009223027099003|18002099003|22082099003|4143699003|6133799003; X-Microsoft-Antispam-Message-Info: TQHx+7uOfXaNsmOp2hHVbmcBmGfr52eOQPEdHDQ6cDnHc96ZQzsQESCjc2eFzJsaxqsWcM6V2Whgneb0SNIBVv8QofD2vncNx8+fk+IqqJrhOKBtBLxSVtAXNln6DT+KbqSEw2zYoRe9bV188UBM1LUtqB6yqMxV7G20pFbkYPAUcK67pp5zVvpI4jUiZ37Qgfh9cTg5upCPWP5dIQPhNfUq6qoHkqMn4xwHWAlfRtYPBy4RGK/nv2v6XRQPaKUGBdgXK8unj7BCO9Qr3VgJXpppbTl50YDHJ8SnatKLkwHkisNeS6km75DyWZGS5wgFpOxWaK6ecXb092yYPhtyyajWWUFgv+iMRp6d+r+J/eGLR5h0MmjccA/MkRRyYt8s3RQAj6QrEN0MBUgM64ACVjcJva7kHf5/4wzIAHlMb7FynZbh0k89x8sEabsgDQTLp6W/WUpbSWAO+2WN7uro8CayYvWC5y4R0LEE8Ay8sU+aY3rWUpORLvSN1EnIToYepnb2PBBUNfGMKnv5be09XCVAEORgWRZ/7RF2idVd99Xe+23nIURParq89mmmzL7dKu0PsZONyoHGhSHWH30Je+dlFCSKrc0KLRzXJUGN6+j71ln/tlTCKdNQxaYkozHzmeTP4RsbfZ6nWCzUCKySk+S7/H9ZI11pxFP6Ff1+W2o= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(36860700016)(82310400026)(376014)(56012099006)(10067099003)(261026140227099003)(261026121527099003)(261028144727099003)(261021121427099003)(261021123027099003)(261102123227099003)(261022105027099003)(261009223027099003)(18002099003)(22082099003)(4143699003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /2uAjIGMm07eUbjN+w0GpSsfNXeFCyDMf4j5mMRaKmhORKUsN0ETv0zBNWwfqOmvOaRK4DLya1R2UJqP5xp22ouz+p5tUuvETVfaxIsF8mxN3UToC0x1t9eu6yAoX/RO+KjGEmVlws+YAvPJeaMR9NmJRbVyeKbWBvfJeErT0J4Lbn+f6tcggF+NOQY+EJItIJ9LXARqHQpy8nxFoXUY3HOJ52NYUboKbtJ+9qMatwaxuVXAgLIiixW0GMjZkOxXPGXsMidm5eUNx6MBTxEof/XOkoM4qEt9GWYJhFKqIrNQHctre0q4ua+RFhXqXrRRhUa7f1dsiTzAPkZahSj/FzgpKNaUibRcXSMW18/iHcRwKilCzxeAXFS1GRoyrYZTHw68iB6XB74gDhbgDa/yCOGPkvm9gPPgWvzKzcCHSUTFdsA0rlCjRsR5oWM0R1yq X-Exchange-RoutingPolicyChecked: Z/FvA7rFA4UD7IUNKn9Hjjk2QpCS8Wg38uhKWaB2tOzFi9p6qPBs/RZhQzRWArQ7Rm64oJyjC5x2jszZtBXAfQD5eUE5sX73Q45kK2UJV6KfmfzkDv6M0j0CZfSYM189zgQCXvuOIj3narEwwNQTJPla2nCZbbXMdvqZK4VWuVo9sdwrjpbbvkKHnUHOsPpsVVDAmQp57Wdf7g2gRiMQGUqO5Pk1gtLdbQyktlF5jxiSj5gVOQBxUJwXtjNEoueEH8rjbo5yjgAI2zZzeHclB03ZYjYPQM8jkog8Ij56tnrW1JTvSzg+1yy9Ub6rVHnNpZ+UrovKA8zUDtjkNN/jzw== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 15:10:38.5235 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a967edf-55da-4769-4c76-08df50866c84 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: MN7PEPF00000151.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4352 X-Proofpoint-ORIG-GUID: 96FX5MI3P-6yS5kXXsXC731diwJvPMTJ X-Proofpoint-GUID: 96FX5MI3P-6yS5kXXsXC731diwJvPMTJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA2MCBTYWx0ZWRfXyqBCKci4ZPI+ zOIx8svTIvAqx1USJOf/o6Thp36S6tS+dZKKmQXqeJ9VzpkEUQZZEKt+tM8eILTEItsz6+Yj0QJ qlOniONW9lTu+Ov64+er0AOjg9EMsoi7qYefDRf8ZPleLn9z6bBp5Qv5e5TDj8CjP5kjgXsSaPx Uqtdo+LFbmX/iAMosGM5k6DuC+VHsT0UCFEztltikmK8l+p5lfVv88c2qTyqPg3oh2KhMV42TvO Yf1bOtQHDQl7V45zO7lMVZ8kC0nGKMURBViaMPXp6jB5nVXx9CsvH/AiAKo3BlkPQqpRLWf69lu giUAjPAnwUd0FRUEmNwRB4LoD55Gz4jgx/FUsEyfaL9yorDb14PcJWaj/qCK/R/Xy7DbyTYnM/+ JSJT4fk+INOe43H4ggvJTicrHiDWVz48yrZwqYSatwq508/RoAyd+6pmVW55C41/fYvEG1J7BIZ puCwW1eKoWpxw5dT6ug== X-Authority-Analysis: v=2.4 cv=SugFe/O0 c=1 sm=1 tr=0 ts=6b1034f1 cx=c_pps a=5ppPJOB7bB2hO4guNQQ//Q==:117 a=iwqwCZQqcuTv3JOpYdM7/Q==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=VwQbUJbxAAAA:8 a=sozttTNsAAAA:8 a=ZSntAmZuB6xAphrjPNcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA2MCBTYWx0ZWRfX+sq4b0evS9qc OaDE2Bgy2+c72ah58E3di59p3PZB2jtAlDkBx4jri2BhhJe2/g0H0AtA+YuuJQMtcf6PLO+JTHe 95zQ7AHr5aGmNJ8gt7YuAUZlA5pBKxM= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_04,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 suspectscore=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020060 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_071100_605046_42D9BDE2 X-CRM114-Status: GOOD ( 18.12 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/2/26 7:26 AM, Sebin Francis wrote: > Hi Beleswar, > > On 29/10/26 23:41, Beleswar Padhi wrote: >> From: Andrew Davis >> >> As the only use for the handle is to fetch the info struct, which is only >> used by the ti_sci_do_xfer() function, move the info struct retrieval >> into that function. This also allows us to move the handle validity check >> inside also, saving us from needing to do this at each message function. >> >> Signed-off-by: Andrew Davis >> Co-developed-by: Beleswar Padhi >> Signed-off-by: Beleswar Padhi >> --- >> v3: Changelog: >> 1. None to this patch. >> >> Link to v2: >> https://lore.kernel.org/all/20260930160607.2674980-10-b-padhi@ti.com/ >> >> v2: Changelog: >> 1. None to this patch. >> >> Link to v1: >> https://lore.kernel.org/all/20260929201746.4078803-10-b-padhi@ti.com/ >> >>   drivers/firmware/ti_sci.c | 306 ++++++++------------------------------ >>   1 file changed, 60 insertions(+), 246 deletions(-) >> >> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c >> index 6d0ecb77d731e..dbe192142bf17 100644 >> --- a/drivers/firmware/ti_sci.c >> +++ b/drivers/firmware/ti_sci.c >> @@ -435,7 +435,7 @@ static inline bool ti_sci_is_response_ack(void *r) >>   /** >>    * ti_sci_do_xfer() - Do one transfer >> - * @info:    Pointer to SCI entity information >> + * @handle:    Pointer to TI SCI handle >>    * @msg_type:    Message type >>    * @msg_flags:    Flag to set for the message >>    * @tx_message: transmit message storage location >> @@ -443,23 +443,26 @@ static inline bool ti_sci_is_response_ack(void *r) >>    * @rx_message: receive message storage location >>    * @rx_message_size: receive message size >>    * >> - * Return: -ETIMEDOUT in case of no response, or >> + * Return: -EINVAL if @handle is NULL, or >> + *         PTR_ERR(@handle) if @handle is an error pointer, or >> + *         -ETIMEDOUT in case of no response, or >>    *         -ENODEV in case of a NACK response, or >>    *         corresponding error if xfer allocation fails, or >>    *         corresponding error if transmit fails, or >>    *         return 0, if all goes well. >>    */ >> -static inline int ti_sci_do_xfer(struct ti_sci_info *info, >> +static inline int ti_sci_do_xfer(const struct ti_sci_handle *handle, >>                    u16 msg_type, u32 msg_flags, >>                    void *tx_message, size_t tx_message_size, >>                    void *rx_message, size_t rx_message_size) >>   { >> +    struct ti_sci_info *info; >>       struct ti_sci_xfer *xfer; >>       bool response_expected = !!(msg_flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED | >>                            TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); >>       int ret; >>       int timeout; >> -    struct device *dev = info->dev; >> +    struct device *dev; >>       bool done_state = true; >>       void *caller; >> @@ -470,6 +473,14 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, >>        */ >>       caller = (void *)_RET_IP_; >> +    if (IS_ERR(handle)) >> +        return PTR_ERR(handle); >> +    if (!handle) >> +        return -EINVAL; >> + >> +    info = handle_to_ti_sci_info(handle); >> +    dev = info->dev; >> + >>       xfer = ti_sci_get_one_xfer(info, msg_type, msg_flags, >>                      tx_message, tx_message_size, >>                      rx_message, rx_message_size, caller); >> @@ -551,7 +562,7 @@ static int ti_sci_cmd_get_revision(struct ti_sci_info *info) >>       struct ti_sci_msg_resp_version resp; >>       int ret; >> -    ret = ti_sci_do_xfer(info, TI_SCI_MSG_VERSION, >> +    ret = ti_sci_do_xfer(handle, TI_SCI_MSG_VERSION, >>                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, >>                    &req, sizeof(req), >>                    &resp, sizeof(resp)); >> @@ -579,22 +590,14 @@ static int ti_sci_cmd_get_revision(struct ti_sci_info *info) >>   static int ti_sci_set_device_state(const struct ti_sci_handle *handle, >>                      u32 id, u32 flags, u8 state) >>   { >> -    struct ti_sci_info *info; >>       struct ti_sci_msg_req_set_device_state req; >>       struct ti_sci_msg_hdr resp; >>       int ret = 0; >> -    if (IS_ERR(handle)) >> -        return PTR_ERR(handle); >> -    if (!handle) >> -        return -EINVAL; >> - >> -    info = handle_to_ti_sci_info(handle); >> - > > Minor > As we are removing the if checkes, there is a simple if that can be removed in most of the functions, but if this is kept for consistency, then we can keep it > We are not removing any checks, we are only relocating the checks to ti_sci_do_xfer(). And although I don't see any such cases that match the code you list below, consistency/clarity is best and making functions explicitly return 0; is more clear than having trying to look back in the function to see what `ret` could have been set to. Andrew > ``` >     if (ret) >         return ret; > >     return 0; > ``` > > Sebin > > > --- >