1beacf11bSopenharmony_ci/**************************************************************************** 2beacf11bSopenharmony_ci * fs/driver/fs_unregisterblockdriver.c 3beacf11bSopenharmony_ci * 4beacf11bSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. 5beacf11bSopenharmony_ci * Based on NuttX originally from nuttx source (nuttx/fs/ and nuttx/drivers/) 6beacf11bSopenharmony_ci * 7beacf11bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 8beacf11bSopenharmony_ci * you may not use this file except in compliance with the License. 9beacf11bSopenharmony_ci * You may obtain a copy of the License at 10beacf11bSopenharmony_ci * 11beacf11bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 12beacf11bSopenharmony_ci * 13beacf11bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 14beacf11bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 15beacf11bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16beacf11bSopenharmony_ci * See the License for the specific language governing permissions and 17beacf11bSopenharmony_ci * limitations under the License. 18beacf11bSopenharmony_ci * 19beacf11bSopenharmony_ci ****************************************************************************/ 20beacf11bSopenharmony_ci 21beacf11bSopenharmony_ci/**************************************************************************** 22beacf11bSopenharmony_ci * Included Files 23beacf11bSopenharmony_ci ****************************************************************************/ 24beacf11bSopenharmony_ci 25beacf11bSopenharmony_ci#include "vfs_config.h" 26beacf11bSopenharmony_ci 27beacf11bSopenharmony_ci#include "fs/driver.h" 28beacf11bSopenharmony_ci 29beacf11bSopenharmony_ci#include "string.h" 30beacf11bSopenharmony_ci#include "errno.h" 31beacf11bSopenharmony_ci 32beacf11bSopenharmony_ci/**************************************************************************** 33beacf11bSopenharmony_ci * Public Functions 34beacf11bSopenharmony_ci ****************************************************************************/ 35beacf11bSopenharmony_ci 36beacf11bSopenharmony_ci/**************************************************************************** 37beacf11bSopenharmony_ci * Name: unregister_blockdriver 38beacf11bSopenharmony_ci * 39beacf11bSopenharmony_ci * Description: 40beacf11bSopenharmony_ci * Remove the block driver inode at 'path' from the pseudo-file system 41beacf11bSopenharmony_ci * 42beacf11bSopenharmony_ci ****************************************************************************/ 43beacf11bSopenharmony_ci 44beacf11bSopenharmony_ciint unregister_blockdriver(const char *path) 45beacf11bSopenharmony_ci{ 46beacf11bSopenharmony_ci if (path == NULL || strlen(path) >= PATH_MAX || strncmp("/dev/", path, DEV_PATH_LEN) != 0) 47beacf11bSopenharmony_ci { 48beacf11bSopenharmony_ci return EINVAL; 49beacf11bSopenharmony_ci } 50beacf11bSopenharmony_ci 51beacf11bSopenharmony_ci return -ENOSYS; 52beacf11bSopenharmony_ci} 53