From patchwork Tue Jul 4 09:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 699117 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 51121EB64D9 for ; Tue, 4 Jul 2023 09:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbjGDJsD (ORCPT ); Tue, 4 Jul 2023 05:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjGDJsC (ORCPT ); Tue, 4 Jul 2023 05:48:02 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09898B5; Tue, 4 Jul 2023 02:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSXDz5n1T5E5DfbR1nmsFQFfkp1K/rs1+Jpjfck0X4ZmMdpTq+KIOH9osEd9objFDsed74IbDcCSV2aar8rv+4fkScUlbyOEPpookZsL3sFwVAkUUgFwa0a1/JzUaxmaoUhxWf0UPhzk9lqzmn9L/0QyFSYUuCh2n7jAFNUsGd4bl2wPFazwk/QyOHgRHB/J2r3Ll+uFjN35gp4Usj5BAXx+EtntAwu2QQxmb4qpai5vdQ4r2ScyqfAq2JK2tT8Eb6/UbKdusQuhQ96CIZMWX+7A9B2kdA9KlNsHsAIsCP57dHYYhNdppb3nB1twVan0OhWTt0ym5tkESxuWrIFAfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=dOyd29o7/7HesSyo8ZnwleujANleMv82dcznKHtuUqWPqrIu/8DwpQBEoEGwj+drjbUf+ShRWAtFIzDh9b7IekAmW+NRDLs10f+mfjIKFVMZDisE3aVOUb5mj2ze+gu1bJ5Hs0mqeoe/NKlBYE+UryB4NvpjZvsm1HWL6KXcYYYis0X/84B0nWHJl5mpPQUsZRF4vR6xTZq2B/BeJQJXzd86kHNhawr/CbfRsVB9+P9g6x9bnkEJBncPqJslIYfBkzmR7QpTXpHz380KkgCWhg8tHavL9hEY+5brxFwwiO38amI1wEbLsEgVV7XM69q8V2UMAHGUx6PIxOU0opT7sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=REaVaGMEYY2NiMB8J9PCRcsCybjVPduWL49ick6nktykJNBgs/ZRtZruJ5kmR2YXLFy3TG40pAI5erweYnfpMV8mysmrToO17ZB0X/O9yuicmlQymgcuv1X5LEh4VnWHjxeEFAVOp+QP0cHkOpYS2tGE/WPr9XuJkirf8rhJlrN2Un2nmvmyWjAYlq5csZEva+b7u+7oDzQwGgULS2kABI30i4uiXou+O/jBd8LQ+RaDUFdd/Z1ghJ+wPLFPKkn0dbAbj9wUV1xV8tQJascJzMn4xgbqpglCMf2CVtyMAg63G9cTSuP8yeGl1LkFZ2uFtRjHrv4gCJ6gXG2kFFbaTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYSPR06MB6768.apcprd06.prod.outlook.com (2603:1096:400:475::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 09:47:57 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 09:47:56 +0000 From: Yangtao Li To: Pavel Machek , Lee Jones Cc: Yangtao Li , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] leds: ip30: Convert to devm_platform_ioremap_resource() Date: Tue, 4 Jul 2023 17:47:45 +0800 Message-Id: <20230704094745.25665-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI1PR02CA0046.apcprd02.prod.outlook.com (2603:1096:4:1f5::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYSPR06MB6768:EE_ X-MS-Office365-Filtering-Correlation-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HaRPRDIe55UkZVtgK0l2ieVPIWyWn9Y3xC5mrv7sK/6zu248abELvnx/7pCLQCLs5UvdRbbSz8TW43dYe+gmPDMvCaWXVZreoJNyEKZMuLfCiKZnbir0fWQ34dEdE7xIUcVeCTp6h21tynQsQNcP59P5Y/vmLG6XGNNcuM+QJ1h0yey186isGC1yr/AulmYNXR97pFXYOGGK65BfOLEI1n1osh/dSFp+LvrIXnFh4KSv1Db28ZhCYlBjt5Y//EnUTdxdrIHMsg4MX6XsFFHu3VQ0gnwgOewhCUa9MThCXhwtmKNrsHKLxEtkwfVMm3lo3MoOk7pI8sqT4oBXl92YtTIKOc4x1PEGS3UWK75uvvscbkTFlp0B2X1DYDrWrkrJKTrwuKWkHuVziiyt237uCbd4K1vzEQqHmDmytYVwTHACqNn5cur8HslOa3cqzbfZ/J7cfq/+yNZii9iEvMOLtiLnaMc0Vu+a/6/8ydzEYp72vuSUy3UdiNQwR8shOmhMzPkrLcLBFW/RxBcfRRnCBEaff886QDai4tZqeExDa1LeH1XG0PmvJt/9NdKxgOlgthxyQ9UZGS/Dyb+3xWWOVwpISQ+fN9jgS5VFDkAax4Zp16zPqpwy+0t8K1SDlo3I X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5269.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(66556008)(86362001)(186003)(26005)(6512007)(66476007)(1076003)(6506007)(83380400001)(2616005)(4744005)(2906002)(6486002)(38100700002)(6666004)(52116002)(38350700002)(5660300002)(478600001)(8676002)(110136005)(8936002)(41300700001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2zvU3lxtI++qMhW80Fu5IKHSDQfgpSh+qG4yV8OTREyxFLXRPCWk/FAAa9SFu9SPUlgr0wl45lzDSz6Djnwoeg++xma/B2pAwQg5etxSIfGC6NL5JeG9s8OpRkHZgLmnJSKW1nFhcjEdAl1nu9eD8S5f5oGN63FIcSObf0v1xzyitTlUIrAGB9YsryU/dXllWrujTFlx8hbA6HzmvCrdjJvbVfPb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dOXg//CCBI43+c9ROfTMh/hWaBSEA9rCucF30XU2weppqFwc1xwh4uNBgJDuPh+MjBkiT/RVTU1fEOVxZzYITGGXUlmce2U35sPbcKVB9xWLfnkyoYYkLOdMebY19khjvpKmrtimc4SUoJdAgC9SlP8+7N5KffmHK33LIsua7sTMf+ecOMMJtnB/C/iQUIZzdidYzk+U38VjfcE5VCSrg21UgoI6IPbskNzKccuUuBPWITs4wmoXQqWhSVXjF9aYK+1ADs8yd/WajRpedL5Gm83JYXOzOMwLi5IRuMFc/vp/vcgt+SgW263IyX X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:47:56.9060 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iX2N6JpLT1Ucdeo0ys0u+x9EW5xdFWUkzWf6HB8VrVOXnUDYg5yWuh8rdgHlngXNr6fxaTANo4zSYSToM2Crkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6768 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/leds/leds-ip30.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/leds/leds-ip30.c b/drivers/leds/leds-ip30.c index 1f952bad0fe8..2df24c303366 100644 --- a/drivers/leds/leds-ip30.c +++ b/drivers/leds/leds-ip30.c @@ -27,22 +27,16 @@ static void ip30led_set(struct led_classdev *led_cdev, static int ip30led_create(struct platform_device *pdev, int num) { - struct resource *res; struct ip30_led *data; - res = platform_get_resource(pdev, IORESOURCE_MEM, num); - if (!res) - return -EBUSY; - data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->reg = devm_ioremap_resource(&pdev->dev, res); + data->reg = devm_platform_ioremap_resource(pdev, num); if (IS_ERR(data->reg)) return PTR_ERR(data->reg); - switch (num) { case IP30_LED_SYSTEM: data->cdev.name = "white:power";