From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0116B301704 for ; Thu, 7 May 2026 23:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778197478; cv=none; b=WGDAygMqA9YUNLahMJNs9qRKKEA3CIwMqryHInZDx+1ml+BNXCcgBCkhnkW+SMTNgI6ANmxoLlVkMqAlg3GYwegVWhfjUVi1S105TRzug8mTnjXKH/7clnoRUCldOMrchWSYIdX/le6fcUW5Nm55kpNbwFFp7xAL+7EE9AzEauE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778197478; c=relaxed/simple; bh=gcQ2TuQUxnhuK45sKX3v074CH0TDFNFxzFXxOOiZPoo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pa+wObJC2YQhEaaKRsqZfgWgV7MGyFdwhj58fG7ZnuNgV2uoaAc/oYgwQjvidtr+2RxwS8DhXdU8v4mHwmOEDKV/s8Z/TTUxsfI95EG5zeSEAFLdjjUp/vcnfF7quX3x8ApVZGXS+DAlD9x5jGF89sH22kiE/wmfNuOXDQZd+Jk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Xbi0XKxp; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xbi0XKxp" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-8acae26e564so13466956d6.2 for ; Thu, 07 May 2026 16:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778197476; x=1778802276; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oqqSkARmaTN3p49h4nEScAG9LlwTFVMGsDAkq9FOFjE=; b=Xbi0XKxp1n/gBmPoQ22L812nnfMMQ7w3Ipjyt06ErBKWtW6XgqLI4yTbaCHMY/s8hH XoP2DpvqDF/doEmpcaddYuLs9xo53paRtkTMrR0r2hwachxr+b1Rl6Mn8XNF/PmdAx88 XTvraGYoCF4TWW0s+HluR2zVydf1EFBjCssxlevBU8+dUV+SYFKbNDM9losmIHpbmD5Z SDKY50xz2kfA/E59byIHxzZ0/BsR6ampIzZhnEgt/J37zbtyeBGwgK6FqqkDtKLDhul5 TRVvNiWCvj9mND0ASuRYDvYirKYJuJiPzptQh+LQ5712leRzb9EFU6iNNI716cwZunlj nelg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778197476; x=1778802276; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oqqSkARmaTN3p49h4nEScAG9LlwTFVMGsDAkq9FOFjE=; b=anXoQyPT+WjUB9AFhS1fodt7hB44648gzIRmzsdzPuP9S1z9Fn4WI6/Oy89vV5rPTF JwH979q85g9AB5kXsgQTtGgR1f4VXn6S1jeHmtbTgBSmgdORml1/PkFDuyd6l9ZYu1Ui gonLNCcilg9XycVuS5sWZxYZj9HqhFjJOLTrBF1DsnUQGDITJ1EDZ4GgtwmaMoPeZMjh Ttcy3wWxQ/Rj7C/y430HPsPOwPTBrvg7123dupokZO6I6R59rZHXVtevpy92Ixw0tcF/ t6xk4/gXdctxx2RiBc17+0VAlLb8xIL5Zl8mRKSDpuZqandEv6t9CU+SYqqvCSBVfnBC AlVA== X-Forwarded-Encrypted: i=1; AFNElJ/84fNLr3fiI/ONGdFWBn+hRDg5wHlNf2Pwi76H1jaa0KM9YF2ht6AoW+gR6SZ9M8IT0gm01gxZCuQ8lSw=@vger.kernel.org X-Gm-Message-State: AOJu0Yzf3oW071PlIefoPmtXFO6H90nN9RADb6WbmUlw8dltU+FQeVE/ iBsmIcelT+8nPfBT6S6IYcT4GTZnrL8zZE+M9djpMKv391sN0Nx4bQCC X-Gm-Gg: Acq92OGveUVMLva+hok1lZJphBNKUntmPd/UYKhidMxfQ+vvCuWYwu4yMKsgZg8A8Cd augUNMYJw2VMVDlE9MmRWeOi1RkkMpzF4YhGRlCWIaSMJwOLoXJun9nQz+ulw5ATtreuthmX3Qj 49j/+eZWqXPb2Jix91JlDc8XyTXvBkrEzYyeJl/CszXjQ5T11Kr45CUm+bsxkvzdfRyP9WPy7aV TntOF3ZDvMFWtiYBHMIM9AuVBOMemp/7hgRj34gkGKDXrbjQuFrBd/4xhJivkAmGxSMcXepInBr yEu7+3AniaARBw0LccxcmK7GDb5pQzWHRrh1X3GVFB+ZbCloWSCOsPbX0PvphyPE5mP6JEQlEUB CrVYboLDb4dD0IQTr6jQqyyFcGbUFJJCInnPjW+vA81kKNnXYIQIDsBVIGdw2NzEKiFu2/9GGrP oZ04nhqiOu7+8u1NakPR7YL6D3oJPhFWRF5mcUwHyoiycTvybTJKKQPhsc0uVVgqkZMTGOrtv/L BfbJE1lbDZjB3uTXLi++z0XPb80Cvw8xxw= X-Received: by 2002:a05:6214:4a88:b0:8a7:3317:6043 with SMTP id 6a1803df08f44-8bc42492ae8mr151438526d6.3.1778197475975; Thu, 07 May 2026 16:44:35 -0700 (PDT) Received: from ryzen ([2601:644:8000:5b5d:7285:c2ff:fe45:8a32]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b53c6b8123sm217144146d6.35.2026.05.07.16.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 16:44:35 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Herbert Xu , "David S. Miller" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] talitos: use devm_platform_ioremap_resource() Date: Thu, 7 May 2026 16:44:16 -0700 Message-ID: <20260507234416.677882-1-rosenp@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit platform_get_resource and devm_ioremap effectively open codes this. The return type of devm_platform_ioremap_resource() is also nice as it has multiple errors that it can return. Because it internally calls devm_request_mem_region(), reg values and sizes cannot overlap. This was manually verified to be the case for all talitos users. Signed-off-by: Rosen Penev --- drivers/crypto/talitos.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index bd4cc06ee13c..bdf7549fdf0a 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3412,7 +3412,6 @@ static int talitos_probe(struct platform_device *ofdev) unsigned int num_channels; int i, err; int stride; - struct resource *res; if (of_property_read_u32(np, "fsl,num-channels", &num_channels)) return -EINVAL; @@ -3431,13 +3430,10 @@ static int talitos_probe(struct platform_device *ofdev) spin_lock_init(&priv->reg_lock); - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - if (!res) - return -ENXIO; - priv->reg = devm_ioremap(dev, res->start, resource_size(res)); - if (!priv->reg) { + priv->reg = devm_platform_ioremap_resource(ofdev, 0); + if (IS_ERR(priv->reg)) { dev_err(dev, "failed to of_iomap\n"); - err = -ENOMEM; + err = PTR_ERR(priv->reg); goto err_out; } -- 2.54.0